CodeSampleX

Exemple

jinja2 3.1.6: Jinja2 strips a single trailing newline from the end of a template by default, unless keep_trailing_newline is True.

Échantillon vérifié pour pypi jinja2 3.1.6: Jinja2 strips a single trailing newline from the end of a template by default, unless keep_trailing_newline is…

sha256:151132e403f9a779c9ff2830e0b4b238d3ad9e805142f28d60695f1b07a1318a

Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré. Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes. MIT-0

Preuves d'exécution

L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.

Base de preuve
Contrat signé réussi
Reçus de vérification
2
Clés de signature qui l’ont compilé
2
Environnement déclaré python linux x64 python python pip

Environnements des exécutions de vérification

Environnement Contrat Étapes Exécution
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

Cas

HOW
Objectif
Jinja2 strips a single trailing newline from the end of a template by default, unless keep_trailing_newline is True.
Paquets
Symboles
  • keep_trailing_newline
Environnement
python
Créé
2026-08-18T09:45:40Z

Contrat

  1. Environment().from_string('hello\n').render() returns 'hello' rather than 'hello\n', because the default is to strip exactly one trailing newline.
  2. assert jinja2.Environment().from_string('hello\n').render() == 'hello'
  3. assert jinja2.Environment().from_string('hello\n\n').render() == 'hello\n'
  4. assert jinja2.Environment(keep_trailing_newline=True).from_string('hello\n').render() == 'hello\n'

Fichiers

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

Télécharger l’artefact source (tar.gz)

Seeder d'origine

csx-seed