CodeSampleX

Beispiel

safe YAML parsing, custom dumping, and safe_load with PyYAML

sha256:f33b03c1fbf97dc469bbba37b68bc06aba094a2206d9f39056a821a0f1d6c247

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
1
Signaturschlüssel, die es gebaut haben
1
Deklarierte Umgebung python linux 24 · ubuntu · glibc 2.39 x64 python python pip

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
python 3.12 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1python:3.12-alpine@sha256:d09d15e60962…
2026-08-27

Fall

HOW
Ziel
safe YAML parsing, custom dumping, and safe_load with PyYAML
Pakete
Symbole
  • yaml.dump
  • yaml.safe_load
Umgebung
python
Erstellt
2026-08-27T18:02:51Z

Contract

  1. yaml.safe_load parses YAML strings and streams into native Python dictionaries, lists, booleans, and scalar types.
  2. yaml.dump serializes Python data structures to formatted YAML strings with support for sort_keys and default_flow_style.
  3. yaml.safe_load accepts file-like stream objects (such as io.StringIO) and parses them identically to string input.
  4. yaml.safe_load raises yaml.YAMLError when encountering syntactically invalid or malformed YAML input.
  5. yaml.safe_load safely rejects dangerous arbitrary Python object instantiation tags (raising yaml.constructor.ConstructorError).
  6. yaml.SafeLoader and yaml.SafeDumper subclasses support custom constructors and representers for domain-specific tag serialization.

Dateien

  • NOTES.md
  • PROMPT.md
  • csx.json
  • requirements.txt
  • spec.json
  • test/contract.py

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

anonym