
    Mhd              
       X   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 Z  ee          e          Zedk    rkddl	m
Z
  e
            Z ed          Ze                    dd             eddd          D ],Z ee          Ze                    de efd           +dS 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$refunevaluatedPropertiesc                     t          g d          }ddddiid}t          t          | dz
            |          D ]\  }}d||id}|S )zL
    Produce a schema which validates deeply nested objects and arrays.
    )foobarbazquuxspameggsobjecthamtypestring)r   
properties   )r   ziprange)levelsnamesschema_names        d/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jsonschema/benchmarks/nested_schemas.pynested_schemar      sr    
 ???@@Euvx6H.IJJFuVaZ((%00 B B4"4.AAM    __main__)Runnerr   )r   z
not nestedc                  @    t                               t                    S N)	validatoris_valid
not_nested r   r   <lambda>r&   1   s    I,>,>z,J,J r         z	nested * c                 6    t                               |           S r!   )r"   r#   )r   s    r   r&   r&   7   s    )"4"4V"<"< r   N)__doc__	itertoolsr   jsonschema.validatorsr   metaschemaishr   r"   __name__pyperfr   runnerr$   
bench_funcr   r   r   r%   r   r   <module>r2      sg   
       / / / / / / == =ABFCGBFAEIM?C  :"! (	 	 	 )MM-((77	zVXXFa(((J
l$J$JKKK%2q// 
 
f---    <<<	
 	
 	
 	
 
 
r   