Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
validators.cpython-313.pyc577 linesDownload Raw Back to __pycache__
1�

2��j7���J�%SrSSKJr SSKJr SSKJrJrJr SSK	J3r4 SSKJr SSK
Jr SSKJrJrJrJr SS	KJr SS5KrSS6KrSS7KrSS8KrSSKJrJrJr SSKJr SS
K J!r! SS9K"r#SS10K$r#SSK%J&r&J'r'J(r(J)r)J*r*J+r+J,r, \(aSSK-J.r. \+R^"5r00r1S\2S'\+Rf"5r4Sr5Sr6S^Sjr7\Rp"\#Rr"\7S95r:SS11\)Rv\&Rx\#RJRzR|\"S54S_Sjjr?S`Sjr@\?"\R�"S50S\'R�_S\(R�_S\'R�_S\(R�_S \(R�_S!\'R�_S"\'R�_S#\(R�_S$\'R�_S\(R�_S%\'R�_S&\'R�_S'\(R�_S(\'R�_S)\'R�_S*\(R�_S+\'R�_\'R�\(R�\(R�\'R�S,.E\)R�\&R�S-\#RJR�R|\(R�S.9r[\?"\R�"S/50S\'R�_S\(R�_S\'R�_S0\'R�_S1\'R�_S\(R�_S"\'R�_S$\'R�_S\(R�_S%\'R�_S&\'R�_S2\'R�_S'\(R�_S(\'R�_S)\'R�_S3\'R�_S*\(R�_\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�S4.	E\)R�\&R�S5\#RJR�R|\(R�S.9ri\?"\R�"S650S\'R�_S\(R�_S\'R�_S0\'R�_S1\'R�_S7\'R�_S8\(R�_S\(R�_S"\'R�_S9\'R�_S:\'R�_S$\'R�_S\(R�_S%\'R�_S&\'R�_S2\'R�_S'\'R�_\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�S;.E\)R�\&R�S<\#RJR�R|\(R�S.9ru\?"\R�"S=50S\'R�_S\(R�_S\'R�_S0\'R�_S1\'R�_S7\'R�_S8\(R�_S\(R�_S"\'R�_S9\'R�_S:\'R�_S$\'R�_S>\'R�_S\(R�_S%\'R�_S&\'R�_S2\'R�_\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�\'R�S?.E\)R�\&R�S@\#RJR�R|\(R�S.9rz\?"\R�"SA50SB\(R�_S\'R�_S\(R�_S\'R�_S0\'R�_S1\'R�_S7\'R�_S8\'R�_SC\'R�_SD\'R�_S"\'R�_S9\'R�_S:\'R�_S$\'R�_S>\'R�_S\(R�_S%\'R�_0S&\'R�_S2\'R�_S'\'R�_S(\'R�_S)\'R�_S3\'R�_S*\'R�_SE\'R�_SF\'R�_SG\'R�_S+\'R�_SH\'R�_SI\'R�_SJ\'R�_SK\'R�_SL\'R�_SM\(R�_E\(GR\'R�SN.E\)GR\&GRSOSP9r�\?"\R�"SQ50SR\'GR_S\'R�_S\'R�_S0\'R�_S1\'R�_S7\'R�_S8\'R�_SC\'R�_SD\'R�_S"\'R�_S9\'R�_S:\'R�_S$\'R�_S>\'R�_S\'GR12_S%\'R�_S&\'R�_0S2\'R�_S'\'R�_S(\'R�_S)\'R�_S3\'R�_S*\'R�_SE\'R�_SF\'R�_SG\'R�_S+\'R�_SH\'R�_SS\'GR_SI\'R�_SJ\'R�_SK\'R�_SL\'R�_SM\'GR_E\'GR\'R�SN.E\)Rv\&RxSTSP9r�\�r�S\2SU'"SVSW5r�SXr�SYr�SZr�S[r�SaS\jr�\04SbS]jjr�g13)czQ14Creation and extension of validators, with implementations for existing drafts.15�)�annotations)�deque)�Iterable�Mapping�Sequence)�	lru_cache)�methodcaller)�
TYPE_CHECKING)�unquote�	urldefrag�urljoin�urlsplit)�warnN)�define�field�fields)�REGISTRY)�HashTrieMap)�_format�	_keywords�_legacy_keywords�_types�_typing�_utils�16exceptions)�	Validatorzdict[str, Validator]�_VALIDATORSc�|�US:Xa"[R"S[SS9 SSKJn U$US:Xa [R"S[SS9 [17$US	:Xa [R"S18[SS9 [$US:Xa.[R"[R[SS9 [$[S[S
U35e)N�	ErrorTreezkImporting ErrorTree from jsonschema.validators is deprecated. Instead import it from jsonschema.exceptions.���19stacklevelr)r�20validatorszvAccessing jsonschema.validators.validators is deprecated. Use jsonschema.validators.validator_for with a given schema.�meta_schemaszxAccessing jsonschema.validators.meta_schemas is deprecated. Use jsonschema.validators.validator_for with a given schema.�RefResolverzmodule z has no attribute )�warningsr�DeprecationWarning�jsonschema.exceptionsrr�
_META_SCHEMAS�_RefResolver�_DEPRECATION_MESSAGE�AttributeError�__name__)�namers  �[D:\code\apps\devtools\python\user_packages\Python313\site-packages\jsonschema/validators.py�__getattr__r0+s����{���
�
�
<���		21�	4���	
��	��
�
�
K���		22���	
��	��
�
�
K���		23���	
��	��
�
��-�-���	24�25��26�7�8�*�,>�t�f�E�27F�F�c�^�U4SjnU$)az28Register the decorated validator for a ``version`` of the specification.29 30Registered validators and their meta schemas will be considered when31parsing :kw:`$schema` keywords' URIs.32 33Arguments:34 35    version (str):36 37        An identifier to use as the version's name38 39Returns:40 41    collections.abc.Callable:42 43        a class decorator to decorate the validator with the version44 45c�b>�U[T'URUR5nU[U'U$�N)r�ID_OF�META_SCHEMAr))�cls�meta_schema_id�versions  �r/�46_validates�validates.<locals>._validatesds.���"��G�����3�?�?�3��(+�
�n�%��47r1�)r9r:s` r/�	validatesr=Os���*�48�r1c�4�SSKJnJn SS0nU"XS9nU"U5n[R"S[49SS9 [RR[R"U5[RRS	9sSSS5 $!,(df   g=f)50Nr)�Request�urlopenz51User-Agentz.python-jsonschema (deprecated $ref resolution))�headersa�Automatically retrieving remote references can be a security vulnerability and is discouraged by the JSON Schema specifications. Relying on this behavior is deprecated and will shortly become an error. If you are sure you want to remotely retrieve your reference and that it is safe to do so, you can find instructions for doing so via referencing.Registry in the referencing documentation (https://referencing.readthedocs.org).�	r!)�default_specification)
�urllib.requestr?r@r&rr'�referencing�Resource�
from_contents�json�load�52jsonschema�DRAFT202012)�urir?r@rA�request�responses      r/�_warn_for_remote_retrieverOls��/��M�N�G��c�+�G�	��	�X��
�
�
5�
��	53��#�#�1�1��I�I�h��"-�"8�"8�"D�"D�2�54�55�	�	�s�A$B	�	56B)�retriever<�items�type[Validator]c�^^^^^^57^^�Um[RRT"T5=(d S[RRS9m[58"UU59UUUUUU4SjS55n[
U5Vs/sH.nUR(dMURUR4PM0 snm60UbRUR5RSS5RSS5n	U	S3=UlUl
[U5"U5nU$s snf)a~61Create a new validator class.62 63Arguments:64 65    meta_schema:66 67        the meta schema for the new validator class68 69    validators:70 71        a mapping from names to callables, where each callable will72        validate the schema property with the given name.73 74        Each callable should take 4 arguments:75 76            1. a validator instance,77            2. the value of the property being validated within the78               instance79            3. the instance80            4. the schema81 82    version:83 84        an identifier for the version that this validator class will85        validate. If provided, the returned validator class will86        have its ``__name__`` set to include the version, and also87        will have `jsonschema.validators.validates` automatically88        called for the given version.89 90    type_checker:91 92        a type checker, used when applying the :kw:`type` keyword.93 94        If unprovided, a `jsonschema.TypeChecker` will be created95        with a set of default types typical of JSON Schema drafts.96 97    format_checker:98 99        a format checker, used when applying the :kw:`format` keyword.100 101        If unprovided, a `jsonschema.FormatChecker` will be created102        with a set of default formats typical of JSON Schema drafts.103 104    id_of:105 106        A function that given a schema, returns its ID.107 108    applicable_validators:109 110        A function that, given a schema, returns the list of111        applicable schema keywords and associated values112        which will be used to validate the instance.113        This is mostly used to support pre-draft 7 versions of JSON Schema114        which specified behavior around ignoring keywords if they were115        siblings of a ``$ref`` keyword. If you're not attempting to116        implement similar behavior, you can typically ignore this argument117        and leave it at its default.118 119Returns:120 121    a new `jsonschema.protocols.Validator` class122 123zurn:unknown-dialect)�124dialect_id�defaultc�~>�\rSrSr%\"Y5r\"Y5rYrYr\	"Y5r125Yr\"SSSS9r
\"\RS9rS\S'\"SSSS	9r\"SS1269rS\S'\"\S
SS9rS\S'\"SSS
SS9rSrUUU4Sjr\\4Sj5r\U4Sj5rU4SjrSU4SjjrS UU4Sjjr Sr!Sr"Sr#SSjr$Sr%g)!�create.<locals>.Validator��F)�init�repr�eq)rZzreferencing.jsonschema.Schema�schemaN�resolver)rUrZ�alias�rUz_format.FormatChecker | None�format_checkerT)rU�kw_onlyrZz%referencing.jsonschema.SchemaRegistry�	_registry�	_resolver)r^rUrarZc�J�[R"S[SS9 SnXlg)NaKSubclassing validator classes is not intended to be part of their public API. A future version will make doing so an error, as the behavior of subclasses isn't guaranteed to stay the same between releases of jsonschema. Instead, prefer composition of validators, wrapping them in an object owned entirely by the downstream library.r r!c��URnURSUR5n[X2S9n[	U5HBnUR127(dMURnURnXq;dM5[X5X'MD U"S0UD6$�Nr\r_r<)	�	__class__�128setdefaultr\�
validator_forrrYr.r^�getattr)�self�changesr7r\�NewValidatorr�	attr_name�	init_names        r/�evolve�;create.<locals>.Validator.__init_subclass__.<locals>.evolve	sx���n�n�� �+�+�H�d�k�k�B��,�V�A��#�C�[�E� �:�:� � %�129�130�I� %���I� �/�-4�T�-E��*�
)�$�.�g�.�.r1)r&rr'rp)r7rps  r/�__init_subclass__�+create.<locals>.Validator.__init_subclass__�s(���M�M�@�#��
�

/� �Jr1c�:>�URc\URnU[La[R"U5nT	RUR5nURU5UlURSLdURSLa/UlOLT"UR5VVs/sH'up4X0R;dMURUX44PM) snnUl[URSS5nUbT"UR5nUb	U"U5 gggs snnf)NTF�131push_scope)rcrb�_REMOTE_WARNING_REGISTRY�SPECIFICATIONS�combine�create_resourcer\�resolver_with_root�_validators�132VALIDATORSrj�
_ref_resolver)133rk�registry�resource�k�vru�id�applicable_validators�id_of�
specifications134       ���r/�__attrs_post_init__�-create.<locals>.Validator.__attrs_post_init__s����~�~�%��>�>���#;�;�-�5�5�h�?�H�(�8�8����E��!)�!<�!<�X�!F����{�{�d�"�d�k�k�U�&:�#%�� �!6�d�k�k� B�$� B����O�O�+�/�T�_�_�Q�'��.� B�$�� �!��!3�!3�\�4�H�J��%��4�;�;�'���>��r�N�"�&��$s�&D�?Dc���[URUS9nU[LaURnU"URUS9nUR	U5H n[135RRU5e g)Nr_)r\r`)rir6�_UNSET�FORMAT_CHECKER�iter_errorsr�SchemaError�create_from)r7r\r`r�	validator�errors      r/�check_schema�&create.<locals>.Validator.check_schema2sg��%�c�o�o�s�C�I���'�!*�!9�!9��!����-��I�#�.�.�v�6�� �,�,�8�8��?�?�7r1c��>�[R"SURRS3[SS9 UR136c#[RURTS9UlUR137$)Nz138Accessing z�.resolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization.r r!)r�)	r&rrgr-r'r}r*�from_schemar\)rkr�s �r/r]�"create.<locals>.Validator.resolver>sq����M�M� ����!8�!8� 9�:%�%�#��
��!�!�)�%1�%=�%=��K�K��&>�&��"��%�%�%r1c�>�URSUR5n[X RS9nTHupEXQ;dM[	X5X'M U"S0UD6$rf)rhr\rirgrj)rkrlr\rmrnro�
evolve_fieldss      �r/rp� create.<locals>.Validator.evolveSsW����'�'��$�+�+�>�F�(����H�L�*7�&���+�)0��)A�G�&�+8� �*�'�*�*r1c1393�"># �UbW[R"S[SS9 T	"U5VVs/sH'up4X0R;dMURUX44PM) nnnOURUR140pRUSLagUSLa[R"SU<3SSUUS9v� gUHcupcnU"XX5=(d SnUHEnURUUUUURS	9 US141;aURRU5 Uv� MG Me gs snnf7f)Nz�Passing a schema to Validator.iter_errors is deprecated and will be removed in a future release. Call validator.evolve(schema=new_schema).iter_errors(...) instead.r r!TF�False schema does not allow �r��validator_value�instancer\r<�r�r�r�r\�type_checker>�if�$ref)r&rr'r|r\r{r�ValidationError�_set�TYPE_CHECKER�schema_path�142appendleft)143rkr��_schemar�r�r#r��errorsr�r�s144         �r/r��%create.<locals>.Validator.iter_errors]s4�����"��
�
�4�145'� �	�!6�g� >�� >����O�O�+�/�T�_�_�Q�'��.� >���146�'+�k�k�4�3C�3C���$����E�!� �0�0�2�8�,�?�"�$(�%�"����#-��	�a�"�4�H�>�D�"��#�E��J�J�"#�()�!)�&�%)�%6�%6�����.��)�)�4�4�Q�7��K�$�$.��)�s�)D�D	�D	�B5Dc1473�># �USLagUSLa[R"SU<3SSUUS9v� gURbURUS9nO<Uc*URRT
R
U55nURX%S9nT"U5H�upxURRU5n	U	cM%U	"XhX5=(d Sn148U149H�nURUUUUURS9 US	;aURRU5 UbURRU5 UbURRU5 Uv� M� M� g7f)150NTFr�r��r\)r\rcr<r�>r�r�)rr�r}rprc�in_subresourceryr|�getr�r�r�r��path)rkr�r\r�r�r]�evolvedr�r�r�r�r�r�r�s            ��r/�descend�!create.<locals>.Validator.descend�sc������~���5�� �0�0�2�8�,�?�"�$(�%�!�����!�!�-��+�+�V�+�4���#�#�~�~�<�<�%�5�5�f�=� �H��+�+�V�+�H��-�f�5���#�.�.�2�2�1�5�	��$��"�7�x�@�F�B��#�E��J�J�"#�()�!)�%�%,�%9�%9�����.��)�)�4�4�Q�7��'��151�152�-�-�d�3�"�.��)�)�4�4�[�A��K�$�
6�s�EEc�6�UR"U0UD6HnUe gr4)r�)rk�args�kwargsr�s    r/�validate�"create.<locals>.Validator.validate�s!���)�)�4�:�6�:����;r1c��URRX5$![Ra% [R"X!UR1535nUSef=fr4)r��is_typer�UndefinedTypeCheck�UnknownTyper\)rkr��type�excs    r/r��!create.<locals>.Validator.is_type�sQ��
$��(�(�0�0��@�@���0�0�
$� �,�,�T�T�[�[�I���t�#�
$�s	��9Ac���URcAURRU5nURUURURS9$[URSS5nUc6URRU5nURX#5sSSS5 $U"U5upcURRU5 [URX#55URR5 $![RR154an[R"U5UeSnAff=f!,(df   g=f!URR5 f=f)N)r]�resolve)r}rc�lookuprEr�Unresolvable�_WrappedReferencingErrorr��contentsr]rj�	resolvingru�list�	pop_scope)rk�refr��resolved�errr��scopes       r/�_validate_reference�-create.<locals>.Validator._validate_reference�s4���!�!�)�L�#�~�~�4�4�S�9�H��|�|���%�%�%�.�.�$���"�$�"4�"4�i��F���?��+�+�5�5�c�:�h�#�|�|�H�?�;�:�'.�c�l�O�E��&�&�1�1�%�8�7�#�D�L�L��$D�E��*�*�4�4�6��)#�-�-�:�:�L�$�=�=�c�B��K��L��;�:���*�*�4�4�6�s/�C9�D6�E�9D3�D.�.D3�6155E�E#c��Ub)[R"S[SS9 URUS9n[	URU5S5nUSL$)Nz�Passing a schema to Validator.is_valid is deprecated and will be removed in a future release. Call validator.evolve(schema=new_schema).is_valid(...) instead.r r!r�)r&rr'rp�nextr�)rkr�r�r�s    r/�is_valid�"create.<locals>.Validator.is_valid�sT���"��
�
�#�156'� �	��{�{�'�{�2����)�)�(�3�T�:�E��D�=� r1)r}rcr{r4)NNN)&r-�157__module__�__qualname__�__firstlineno__�dictr|r6r�r��staticmethodr5�_APPLICABLE_VALIDATORSrr{�reprlibrZr\�__annotations__r}r`rvrbrcrrr��classmethodr�r��propertyr]rpr�r�r�r�r�r��__static_attributes__)r�r��format_checker_argr��meta_schemar�r�r#s��������r/rrW�s����*�%�158��;�'��#��+���U�#��!6����U�u�=��05�7�<�<�0H��-�H��d��j�I�
�7<�T�7J��4�J�;@�,���<159�	�8�	160�161�����	162�	�	 �@	#�0163�5;�		@�164�		@�165�	&�166�	&�(	+�-	 �f���
2	 �2	 �h	�	$�	7�4	!r1r� ��-)rErJ�specification_with�
Specification�OPAQUErrrYr.r^�title�replacer-r�r=)
r�r#r9r�r`r�r�rr�safer�r�r�s
`` ` ``   @@@r/�creater��s����^(���*�*�=�=���%�>�)>��)�)�0�0�>��M�167�U!�U!�U!��U!�r�I�&��&�E��:�:�	"����U�[�[�!�&��M����}�}��&�&�s�B�/�7�7��R�@��9=��i�6H�H�	��Y�3��g�&�y�1�	����s�:D	�D	c168���[UR5nURU5 UcURnUcURn[URUUUUURURS9$)a8169Create a new validator class by extending an existing one.170 171Arguments:172 173    validator (jsonschema.protocols.Validator):174 175        an existing validator class176 177    validators (collections.abc.Mapping):178 179        a mapping of new validator callables to extend with, whose180        structure is as in `create`.181 182        .. note::183 184            Any validator callables with the same name as an185            existing one will (silently) replace the old validator186            callable entirely, effectively overriding any validation187            done in the "parent" validator class.188 189            If you wish to instead extend the behavior of a parent's190            validator callable, delegate and call it directly in191            the new validator function by retrieving it using192            ``OldValidator.VALIDATORS["validation_keyword_name"]``.193 194    version (str):195 196        a version for the new validator class197 198    type_checker (jsonschema.TypeChecker):199 200        a type checker, used when applying the :kw:`type` keyword.201 202        If unprovided, the type checker of the extended203        `jsonschema.protocols.Validator` will be carried along.204 205    format_checker (jsonschema.FormatChecker):206 207        a format checker, used when applying the :kw:`format` keyword.208 209        If unprovided, the format checker of the extended210        `jsonschema.protocols.Validator` will be carried along.211 212Returns:213 214    a new `jsonschema.protocols.Validator` class extending the one215    provided216 217.. note:: Meta Schemas218 219    The new validator class will have its parent's meta schema.220 221    If you wish to change or extend the meta schema in the new222    validator class, modify ``META_SCHEMA`` directly on the returned223    class. Note that no implicit copying is done, so a copy should224    likely be made before modifying it, in order to not affect the225    old validator.226 227)r�r#r9r�r`r�r�)	r�r|�updater�r�r�r6r5r�)r�r#r9r�r`�all_validatorss      r/�extendr�sw��F�)�.�.�/�N����*�%��� �-�-����"�1�1����)�)�!��!�%��o�o�'�>�>��r1z'http://json-schema.org/draft-03/schema#r��additionalItems�additionalProperties�dependencies�disallow�divisibleBy�enum�extends�format�maxItems�	maxLength�maximum�minItems�	minLength�minimum�pattern)�patternProperties�228propertiesr��uniqueItems�draft3)r�r#r�r`r9r�r�z'http://json-schema.org/draft-04/schema#�allOf�anyOf�
maxProperties�
minProperties)	�229multipleOf�not�oneOfr�r�r��requiredr�r��draft4z'http://json-schema.org/draft-06/schema#�const�contains�exclusiveMaximum�exclusiveMinimum)r�r�rr�rrrr�r�r��
propertyNamesrr�r��draft6z'http://json-schema.org/draft-07/schema#r�)r�r�r�rr�rrrr�r�r�rrr�r��draft7z,https://json-schema.org/draft/2019-09/schemaz
$recursiveRef�dependentRequired�dependentSchemasrrrr�r�rrr��unevaluatedItems)�unevaluatedPropertiesr�zdraft2019-09)r�r#r�r`r9z,https://json-schema.org/draft/2020-12/schemaz$dynamicRef�prefixItemszdraft2020-12�_LATEST_VERSIONc�>�\rSrSrSrSr\"5SSSS4Sjr\\	RRR4Sj5r
S	rS230r\S5r\S5r\R(S
5r\R(S5rSr\S5r\S5rSrSrSrSrSrg)r*i^a�231Resolve JSON References.232 233Arguments:234 235    base_uri (str):236 237        The URI of the referring document238 239    referrer:240 241        The actual referring document242 243    store (dict):244 245        A mapping from URIs to documents to cache246 247    cache_remote (bool):248 249        Whether remote refs should be cached after first resolution250 251    handlers (dict):252 253        A mapping from URI schemes to functions that should be used254        to retrieve them255 256    urljoin_cache (:func:`functools.lru_cache`):257 258        A cache that will be used for caching the results of joining259        the resolution scope to subscopes.260 261    remote_cache (:func:`functools.lru_cache`):262 263        A cache that will be used for caching the results of264        resolved remote URLs.265 266Attributes:267 268    cache_remote (bool):269 270        Whether remote refs should be cached after first resolution271 272.. deprecated:: v4.18.0273 274    ``RefResolver`` has been deprecated in favor of `referencing`.275 276a|jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.Tr<Nc�T�Uc[S5"[5nUc[S5"UR5nX lX@l[U5UlU/Ul[R"S[R"555UlURRS[R555 URRU5 URRSUR555 X RU'X`lXplg)Nic3�@# �UHupXR4v� M g7fr4)r�)�.0rL�eachs   r/�	<genexpr>�(_RefResolver.__init__.<locals>.<genexpr>�s���$277�2H�Y�S�S�-�-� �2H���c3�@# �UHupXR4v� M g7fr4)r6)rr�rs   r/rr�s���278�3H�x�r�R�!�!�"�3H�rc3�n# �UH+n[U[5(dMSU;dM"USU4v� M- g7f)�$idN)�279isinstancer)rr\s  r/rr�s8���280�(���&�'�*�
$�/4���
$�V�E�]�F�#�(�s�5�5�5)rr
�resolve_from_url�referrer�cache_remoter��handlers�
_scopes_stackr�URIDictrwrQ�storer�r)�values�_urljoin_cache�
_remote_cache)rk�base_urir!r&r"r#�
urljoin_cache�remote_caches        r/�__init__�_RefResolver.__init__�s���� �%�d�O�G�4�M���$�T�?�4�+@�+@�A�L� �
�(���X���
�&�Z����^�^�$281�2@�2F�2F�2H�$282�283��284�	
�285�286���287�3@�3F�3F�3H�288�	289�	
�290�291���%� ��292�293���294��,�,�.�295�	296�297 (�298�299�8��+��)�r1c�4�U"X2"U5=(d SUS.UD6$)z�300Construct a resolver from a JSON schema object.301 302Arguments:303 304    schema:305 306        the referring schema307 308Returns:309 310    `_RefResolver`311 312r�)r*r!r<)r7r\r�r�r�s     r/r��_RefResolver.from_schema�s!��,�4�E�&�M�/�R�&�R�6�R�Rr1c�n�URRURURU55 g)zf313Enter a given sub-scope.314 315Treats further dereferences as being performed underneath the316given scope.317N)r$�appendr(�resolution_scope�rkr�s  r/ru�_RefResolver.push_scope�s.��	
���!�!����� 5� 5�u�=�	318r1c��URR5 g![a [R"S5Sef=f)z�319Exit the most recent entered scope.320 321Treats further dereferences as being performed underneath the322original scope.323 324Don't call this method more times than `push_scope` has been325called.326znFailed to pop the scope from an empty stack. `pop_scope()` should only be called once for every `push_scope()`N)r$�pop�327IndexErrorr�_RefResolutionError�rks r/r��_RefResolver.pop_scope�sE��	����"�"�$���	��0�0�!���	
�	�s��"?c� �URS$)z(328Retrieve the current resolution scope.329�����)r$r:s r/r3�_RefResolver.resolution_scope�s��330�!�!�"�%�%r1c�4�[UR5upU$)z<331Retrieve the current base URI, not including any fragment.332)rr3)rkrL�_s   r/r*�_RefResolver.base_uri�s��333�4�0�0�1����334r1c#�# �[R"S[SS9 URU5 Sv� UR	5 g!UR	5 f=f7f)z\335Temporarily enter the given scope for the duration of the context.336 337.. deprecated:: v4.0.0338zVjsonschema.RefResolver.in_scope is deprecated and will be removed in a future release.�r!N)r&rr'rur�r4s  r/�in_scope�_RefResolver.in_scopesH���	�
�
�
+���		339�	
�����	���N�N���D�N�N��s�,A�A�A�A�Ac#�# �URU5up#URU5 Uv� UR5 g!UR5 f=f7f)z�340Resolve the given ``ref`` and enter its resolution scope.341 342Exits the scope on exit of this context manager.343 344Arguments:345 346    ref (str):347 348        The reference to resolve349 350N)r�rur�)rkr��urlr�s    r/r��_RefResolver.resolvingsA������S�)�
�������	��N��N�N���D�N�N��s�%A�=�A�A�Ac�(�UR5U$r4)�_get_subschemas_cache)rk�keys  r/�_find_in_referrer�_RefResolver._find_in_referrer+s���)�)�+�C�0�0r1c��[Vs0sHo/_M nn[UR[5Hup4X#R	U5 M U$s snfr4)�_SUBSCHEMAS_KEYWORDS�_search_schemar!�_match_subschema_keywordsr2)rkrK�cache�keyword�	subschemas     r/rJ�"_RefResolver._get_subschemas_cache.sT��$8�9�$8�S�b��$8��9�"0��M�M�4�#351��G�
�N�!�!�)�,�#352����:s�Ac�t�UR5SnU(dg[U5up4UH�nUSn[U[5(dMUR	UR353U5nUR
S5UR
S5:XdMaU(aURXT5nXPRU'X4s $ g)Nr�/)	rJrr�strr(r3�rstrip�resolve_fragmentr&)rkrG�354subschemasrL�fragmentrTr��355target_uris        r/�_find_in_subschemas� _RefResolver._find_in_subschemas7s����/�/�1�%�8�356���!�#��
��#�I��5�!�B��b�#�&�&���,�,�T�-B�-B�B�G�J�� � ��%����C��8�� $� 5� 5�i� J�I�"+�357�358�3���~�%�$�r1c��URURU5RS5nURU5nUbU$X R	U54$)z359Resolve the given reference.360rW)r(r3rYr^r))rkr�rG�matchs    r/r��_RefResolver.resolveIsV���!�!�$�"7�"7��=�D�D�S�I���(�(��-�����L��&�&�s�+�+�+r1c��[U5upU(dURnURUnURX25$![a> UR	U5nN/![361an[R"U5UeSnAff=ff=f)z362Resolve the given URL.363N)	rr*r&�KeyError�resolve_remote�	Exceptionrr9rZ)rkrGr\�documentr�s     r/r �_RefResolver.resolve_from_urlUs���"�#��
����-�-�C�	C��z�z�#��H��$�$�X�8�8��
�	C�
C��.�.�s�3����
C� �4�4�S�9�s�B��
C��	C�s)�A�364B365�
A � 366B�*B�B�B367c�^�URS5nU(dT$TURLa
URnOU4SjnSH nU"U5HnX%U:XdM
Us s $ M" SH#nU"U5HnSU-XT:XdMUs s $ M% U(a[U5R	S5O/nUHLnURSS5RSS5n[
T[5(a[U5nTUmMN T$![a Nf=f![[4a n[R"S	U<35UeS368nAff=f)z�369Resolve a ``fragment`` within the referenced ``document``.370 371Arguments:372 373    document:374 375        The referent document376 377    fragment (str):378 379        a URI fragment to resolve within it380 381rWc3�L># �[T[U55Shv�N gN7fr4)rP�_match_keyword)rKrgs �r/�find�+_RefResolver.resolve_fragment.<locals>.finds����)�(�N�3�4G�H�H�H�s�$�"�$)�$anchor�$dynamicAnchor)r�r�#z~1z~0�~zUnresolvable JSON pointer: N)�lstripr!rLr�splitr�rr�int�382ValueError�	TypeError�LookupErrorrr9)	rkrgr\rlrSrT�parts�partr�s	 `       r/rZ�_RefResolver.resolve_fragmentgsN����?�?�3�'����O��t�}�}�$��)�)�D�
I�5�G�!�'�]�	���1�1�$�$�+�5�%�G�!�'�]�	���>�Y�%7�7�$�$�+�%�19���!�'�'��,�b���D��<�<��c�*�2�2�4��=�D��(�H�-�-���t�9�D�
�#�D�>������"������{�+�
� �4�4�1�(��>�����
�s*�-D�9D�383D�D�E�$D?�?Ec���SSKn[U5RnX0R;aURU"U5nOwUS;a'U(a URU5R
5nOJSSKJn U"U5n[R"UR5RS55nSSS5 UR(aWURU'W$![a SnN�f=f!,(df   NB=f)ag384Resolve a remote ``uri``.385 386If called directly, does not check the store first, but after387retrieving the document at the specified URI it will be saved in388the store if :attr:`cache_remote` is True.389 390.. note::391 392    If the requests_ library is present, ``jsonschema`` will use it to393    request the remote ``uri``, so that the correct encoding is394    detected and used.395 396    If it isn't, or if the scheme of the ``uri`` is not ``http`` or397    ``https``, UTF-8 is assumed.398 399Arguments:400 401    uri (str):402 403        The URI to resolve404 405Returns:406 407    The retrieved document408 409.. _requests: https://pypi.org/project/requests/410 411rN)�http�https)r@zutf-8)�requests�ImportErrorr�schemer#r�rHrDr@�loads�read�decoder"r&)rkrLr~r��resultr@rGs       r/re�_RefResolver.resolve_remote�s���<	���#��%�%���]�]�"��]�]�6�*�3�/�F�
�(�
(�X��\�\�#�&�+�+�-�F�
/��������C�H�H�J�$5�$5�g�$>�?������$�D�J�J�s�O��
��'�	��H�	����s�C�;4C+�C(�'C(�+412C9)r)r$r(r"r#r!r&) r-r�r�r��__doc__r+rr-r�rErJrKr�r�rur�r�r3r*�413contextlib�contextmanagerrDr�rLrrJr^r�r rZrer�r<r1r/r*r*^s��.�b	E���m�����$*�L��$�$�0�0�6�6�S��S�.	414��&�&��&�����������$������(1���������"415,�9�$5�n3r1r*)rr�rnroc�^�U4SjnU$)Nc3�$># �TU;aUv� gg7fr4r<��valuerSs �r/�matcher�_match_keyword.<locals>.matcher�s�����e���K��s�
r<)rSr�s` r/rkrk�s�����Nr1c#�># �[HnX;dM416X4v� M g7fr4)rOr�s  r/rQrQ�s���'�����.� �(�s�
�417c#��# �[U/5nU(a`UR5n[U[5(dM.U"U5Shv�N UR	UR55 U(aM_ggN.7f)zBreadth-first search routine.N)rr7rr��418extendleftr')r\r�r'r�s    r/rPrP�s[���
�F�8�_�F�419��420�421����%��&�&���5�>�!�!����%�,�,�.�)��&�	"�s�AA9�A7�	*A9�5A9c��Uc[U5nURU5 U"U/UQ70UD6n[R"UR	U55nUbUeg)a�422Validate an instance under the given schema.423 424    >>> validate([2, 3, 4], {"maxItems": 2})425    Traceback (most recent call last):426        ...427    ValidationError: [2, 3, 4] is too long428 429:func:`~jsonschema.validators.validate` will first verify that the430provided schema is itself valid, since not doing so can lead to less431obvious error messages and fail in less obvious or consistent ways.432 433If you know you have a valid schema already, especially434if you intend to validate multiple instances with435the same schema, you likely would prefer using the436`jsonschema.protocols.Validator.validate` method directly on a437specific validator (e.g. ``Draft202012Validator.validate``).438 439 440Arguments:441 442    instance:443 444        The instance to validate445 446    schema:447 448        The schema to validate with449 450    cls (jsonschema.protocols.Validator):451 452        The class that will be used to validate the instance.453 454If the ``cls`` argument is not provided, two things will happen455in accordance with the specification. First, if the schema has a456:kw:`$schema` keyword containing a known meta-schema [#]_ then the457proper validator will be used. The specification recommends that458all schemas contain :kw:`$schema` properties for this reason. If no459:kw:`$schema` property is found, the default validator class is the460latest released draft.461 462Any other provided positional and keyword arguments will be passed463on when instantiating the ``cls``.464 465Raises:466 467    `jsonschema.exceptions.ValidationError`:468 469        if the instance is invalid470 471    `jsonschema.exceptions.SchemaError`:472 473        if the schema itself is invalid474 475.. rubric:: Footnotes476.. [#] known by a validator registered with477    `jsonschema.validators.validates`478 479N)rir�r�480best_matchr�)r�r\r7r�r�r�r�s       r/r�r��sa��x�{��F�#�����V���F�,�T�,�V�,�I��!�!�)�"7�"7��"A�B�E�����r1c���U[La[OUnUSLdUSLdSU;aU$US[;aU[La[S[SS9 [RUSU5$)a481Retrieve the validator class appropriate for validating the given schema.482 483Uses the :kw:`$schema` keyword that should be present in the given484schema to look up the appropriate validator class.485 486Arguments:487 488    schema (collections.abc.Mapping or bool):489 490        the schema to look at491 492    default:493 494        the default to return if the appropriate validator class495        cannot be determined.496 497        If unprovided, the default is to return the latest supported498        draft.499 500Examples:501 502    The :kw:`$schema` JSON Schema keyword will control which validator503    class is returned:504 505    >>> schema = {506    ...     "$schema": "https://json-schema.org/draft/2020-12/schema",507    ...     "type": "integer",508    ... }509    >>> jsonschema.validators.validator_for(schema)510    <class 'jsonschema.validators.Draft202012Validator'>511 512 513    Here, a draft 7 schema instead will return the draft 7 validator:514 515    >>> schema = {516    ...     "$schema": "http://json-schema.org/draft-07/schema#",517    ...     "type": "integer",518    ... }519    >>> jsonschema.validators.validator_for(schema)520    <class 'jsonschema.validators.Draft7Validator'>521 522 523    Schemas with no ``$schema`` keyword will fallback to the default524    argument:525 526    >>> schema = {"type": "integer"}527    >>> jsonschema.validators.validator_for(528    ...     schema, default=Draft7Validator,529    ... )530    <class 'jsonschema.validators.Draft7Validator'>531 532    or if none is provided, to the latest version supported.533    Always including the keyword when authoring schemas is highly534    recommended.535 536TFz$schemaz�The metaschema specified by $schema was not found. Using the latest draft to validate, but this will raise an error in the future.r r!)r�rr)rr'r�)r\rU�DefaultValidators   r/riri7sr��z+2�V�*;����
��~��5��I�V�,C���
�i��
�-�'�V�2C��*�
��	537����V�I�.�0@�A�Ar1)rLrX)r�z#referencing.jsonschema.ObjectSchemar#zcMapping[str, _typing.SchemaKeywordValidator] | Iterable[tuple[str, _typing.SchemaKeywordValidator]]r9z538str | Noner�z_types.TypeCheckerr`z_format.FormatCheckerr�z
_typing.id_ofr�z_typing.ApplicableValidators�returnrR)r<NNNr4)rUztype[Validator] | _utils.Unsetr�rR)�r��539__future__r�collectionsr�collections.abcrrr�	functoolsr�operatorr	�typingr540�urllib.parserrr
rr&rr�rHr��attrsrrr�jsonschema_specificationsrrw�rpdsr�referencing.exceptionsrE�referencing.jsonschemarJrrrrrrr�jsonschema.protocolsr�Unsetr�rr�r%r)r0r=rOrx�Registryrv�draft202012_type_checker�draft202012_format_checkerrKr�r�r�r�r�r�r��dependencies_draft3�disallow_draft3rr��extends_draft3r��items_draft3_draft4r�r��maximum_draft3_draft4r�r��minimum_draft3_draft4r�r��properties_draft3�type_draft3r��draft3_type_checker�draft3_format_checker�DRAFT3�ignore_ref_siblings�Draft3Validatorr�r��!dependencies_draft4_draft6_draft7rr�not_rr�rr��draft4_type_checker�draft4_format_checker�DRAFT4�Draft4Validatorr�contains_draft6_draft7r	r541�items_draft6_draft7_draft201909r�r�r�draft6_type_checker�draft6_format_checker�DRAFT6�Draft6Validator�if_�draft7_type_checker�draft7_format_checker�DRAFT7�Draft7Validator�recursiveRefrrr�unevaluatedItems_draft2019�unevaluatedProperties_draft2019�draft201909_type_checker�draft201909_format_checker�Draft201909Validator�542dynamicRefrQrrr�Draft202012Validatorrr*rOrkrQrPr�rir<r1r/�<module>r�s����#��7�7��!� �>�>������'�'�@��������.�	�����$&��
!�&���� �
�!G�H�:543�.*�1�1����";�<���	��'-�'F�'F�,3�,N�,N�&�1�1�=�=�C�C�:F��;�y�4�y�	?�y��
y�%�y�*�y��y�8�y��y�|����R�j��'�'�1����	�
�
���+�;�;��	�	� >� >��	�(�<�<�	�544	�$�4�4��	�y�+�+�
�	�	����	�#�2�2��	�)�"�"��	�!�5�5��	�I�&�&��	�Y�(�(��	�#�9�9��	�I�&�&��	�Y�(�(�� 	�#�9�9�!�"	�9�$�$�#�$'�8�8�&�8�8� �,�,� �,�,�+�.�+�+��0�0��545�546 �547 �548'�549'�550-�551-�*�>�>�? ��D��'�'�1����	�
�
���+�;�;��	�	� >� >��	����	�552	�����	�(�J�J�
�	�	����	�)�"�"��	�!�5�5��	�I�&�&��	�Y�(�(��	��0�0��	�#�9�9��	�I�&�&��	�Y�(�(�� 	��0�0�!�"	�#�9�9�#�$ �*�*��~�~�����$�$�&�8�8��*�*��&�&���� �,�,�5�8�+�+��0�0��553�554 �555 �556'�557'�558-�559-�*�>�>�I%��N��'�'�1�� ��	�
�
� ��+�;�;� �	�	� >� >� �	����	 �560	���� �	����
 �	�$�;�;� �	�(�J�J� �	�	��� �	�I�6�6� �	�I�6�6� �	�)�"�"� �	�!�A�A� �	�I�&�&� �	�Y�(�(� � 	��0�0�! �"	�9�$�$�# �$�&�&��(�(�"�0�0��$�$��*�*��~�~�����$�$�&�8�8��*�*�"�0�0��&�&���� �,�,�? �B�+�+��0�0��561�562 �563 �564'�565'�566-�567-�*�>�>�S*��X��'�'�1��!��	�
�
�!��+�;�;�!�	�	� >� >�!�	����	!�568	����!�	����
!�	�$�;�;�!�	�(�J�J�!�	�	���!�	�I�6�6�!�	�I�6�6�!�	�)�"�"�!�	
�i�m�m�!�	�!�A�A�!�	�I�&�&�!� 	�Y�(�(�!!�"	��0�0�#!�$�$�$��&�&��(�(�"�0�0��$�$��*�*��~�~�����$�$�&�8�8��*�*�"�0�0��&�&���� �,�,�A!�D�+�+��0�0��569�570 �571 �572'�573'�574-�575-�*�>�>�U+��Z��'�'�6��'��)�6�6�'��	�
�
�'�	�+�;�;�'�	�	� >� >�	'�576	����'�	����
'�	����'�	�I�&�&�'�	�Y�8�8�'�	�I�6�6�'�	�	���'�	�I�6�6�'�	�I�6�6�'�	�)�"�"�'�	
�i�m�m�'� 	�!�A�A�!'�"	�I�&�&�#'�$	�Y�(�(�%'�&	��0�0�''�(	�9�$�$�)'�*	�I�&�&�+'�,	�Y�(�(�-'�.	��0�0�/'�0	�9�$�$�1'�2	�i�*�*�3'�4	�y�~�~�5'�6	����7'�8	�9�$�$�9'�:	�Y�8�8�;'�<	�i�*�*�='�>	��0�0�?'�@	�I�&�&�A'�B	�	���C'�D	�,�G�G�E'�H
�<�<� �,�,�M'�P�0�0��5�5��]/��b��'�'�6��%��y�+�+�%��	�
�
�%�	�	� >� >�%�	����	%�577	����%�	����
%�	�I�&�&�%�	�Y�8�8�%�	�I�6�6�%�	�	���%�	�I�6�6�%�	�I�6�6�%�	�)�"�"�%�	
�i�m�m�%�	����%� 	�I�&�&�!%�"	�Y�(�(�#%�$	��0�0�%%�&	�9�$�$�'%�(	�I�&�&�)%�*	�Y�(�(�+%�,	��0�0�-%�.	�9�$�$�/%�0	�i�*�*�1%�2	�y�~�~�3%�4	����5%�6	�9�$�$�7%�8	�Y�8�8�9%�:	�y�,�,�;%�<	�i�*�*�=%�>	��0�0�?%�@	�I�&�&�A%�B	�	���C%�D	�I�6�6�E%�F"+�!@�!@� �,�,�I%�L�0�0��5�5��Y-��^$8���7�s�s�lB���!�*�C�P/5�KB�
+�KB��KBr1
codekingpro/portable-devtools · Team Ai