a
    �Ï?ec  ã                
   @   sÀ   d Z ddlmZ ddlmZ ddddddddddœddd	d
œZdd„ ZeeƒeƒZedkr¼ddl	m
Z
 e
ƒ Zedd�Ze ddd„ ¡ edddƒD ](Zeed�Ze de› �efdd„¡ q’dS )zŽ
Validating highly nested schemas shouldn't cause exponential time blowups.

See https://github.com/python-jsonschema/jsonschema/issues/1097.
é    )Úcycle)Úvalidator_forz/https://example.com/draft/2020-12/schema/strictz,https://json-schema.org/draft/2020-12/schemaT)z0https://json-schema.org/draft/2020-12/vocab/corez6https://json-schema.org/draft/2020-12/vocab/applicatorz7https://json-schema.org/draft/2020-12/vocab/unevaluatedz6https://json-schema.org/draft/2020-12/vocab/validationz5https://json-schema.org/draft/2020-12/vocab/meta-dataz=https://json-schema.org/draft/2020-12/vocab/format-annotationz3https://json-schema.org/draft/2020-12/vocab/contentÚmetaF)z$idz$schemaz$vocabularyz$dynamicAnchorz$refZunevaluatedPropertiesc                 C   sL   t g d¢ƒ}ddddiidœ}tt| d ƒ|ƒD ]\}}d||idœ}q0|S )zL
    Produce a schema which validates deeply nested objects and arrays.
    )ZfooÚbarZbazZquuxZspamÚeggsÚobjectZhamÚtypeÚstring)r   Z
propertiesé   )r   ÚzipÚrange)ÚlevelsÚnamesÚschemaÚ_Úname© r   úg/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/jsonschema/benchmarks/nested_schemas.pyÚnested_schema   s
    r   Ú__main__)ÚRunnerr
   )r   z
not nestedc                   C   s
   t  t¡S ©N)Ú	validatorÚis_validÚ
not_nestedr   r   r   r   Ú<lambda>1   ó    r   é   é   z	nested * c                 C   s
   t  | ¡S r   )r   r   )r   r   r   r   r   7   r   N)Ú__doc__Ú	itertoolsr   Zjsonschema.validatorsr   Zmetaschemaishr   r   Ú__name__Zpyperfr   Úrunnerr   Z
bench_funcr   r   r   r   r   r   r   Ú<module>   s:   ù	ð


þ