CodeSampleX

Exemple

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

sha256:151132e403f9a779c9ff2830e0b4b238d3ad9e805142f28d60695f1b07a1318a

État de publication. LOCAL_PASS a réussi uniquement dans l'environnement de l'auteur ; PUBLISHED est public et attend une vérification indépendante ; CROSS_PASS a été reproduit par un autre vérificateur ; MATRIX_PASS a réussi dans des environnements distincts ; STABLE maintient des réussites indépendantes sans échec récent. Force de la preuve. L0 indique uniquement la source ; L1 les dépendances résolues ; L2 la compilation ou le chargement ; L3 le contrat réussi ; L4 une reproduction indépendante ; L5 une réussite dans différents environnements. MIT-0

Preuves d'exécution

L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.

Base de preuve
Vérification croisée indépendante
Reçus de vérification
2
Niveau de vérification
L4_CROSS_PASS

Environnement déclaré

Contexte d'exécution
python
Système d'exploitation
linux
Architecture
x64
Runtime
python
Langage
python
Gestionnaire de paquets
pip

Environnements des exécutions de vérification

python 3.12 · linux alpine/x64 · docker PASS
Contexte d'exécution
python 3.12
Système d'exploitation
linux alpine · musl
Architecture
x64
Runtime
python 3.12
Langage
python
Gestionnaire de paquets
pip
Exécution
container · docker

CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-18

python 3.12 · linux alpine/x64 · docker PASS
Contexte d'exécution
python 3.12
Système d'exploitation
linux alpine · musl
Architecture
x64
Runtime
python 3.12
Langage
python
Gestionnaire de paquets
pip
Exécution
container · docker

CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · 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

Reçus de vérification

  • python 3.12 · linux alpine/x64 · docker PASS
    CONTAINER_RUN compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS python@1
    ed25519:d91480838ac982c9
  • python 3.12 · linux alpine/x64 · docker PASS
    CONTAINER_RUN compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS python@1
    ed25519:2175b912ea1c23b1