%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jsonschema/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jsonschema/__pycache__/_utils.cpython-312.pyc

�

`��d�(���ddlmZmZmZddlmZddlZddlZddlZddl	Z	e	jdk\rddlmZnddl
ZGd�de�ZGd�d	e�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Ze�e�fd�Zd�Zd�Zd�Zy)�)�Mapping�MutableMapping�Sequence)�urlsplitN)��	)�	resourcesc�@�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�URIDictz8
    Dictionary which uses normalized URIs as keys.
    c�4�t|�j�S�N)r�geturl��self�uris  �3/usr/lib/python3/dist-packages/jsonschema/_utils.py�	normalizezURIDict.normalizes����}�#�#�%�%�c�Z�t�|_|jj|i|��yr
)�dict�store�update)r�args�kwargss   r�__init__zURIDict.__init__s$���V��
���
�
���4�*�6�*rc�>�|j|j|�Sr
�rrrs  r�__getitem__zURIDict.__getitem__s���z�z�$�.�.��-�.�.rc�@�||j|j|�<yr
r)rr�values   r�__setitem__zURIDict.__setitem__s��*/��
�
�4�>�>�#�&�'rc�<�|j|j|�=yr
rrs  r�__delitem__zURIDict.__delitem__!s���J�J�t�~�~�c�*�+rc�,�t|j�Sr
)�iterr�rs r�__iter__zURIDict.__iter__$����D�J�J��rc�,�t|j�Sr
)�lenrr&s r�__len__zURIDict.__len__'s���4�:�:��rc�,�t|j�Sr
)�reprrr&s r�__repr__zURIDict.__repr__*r(rN)�__name__�
__module__�__qualname__�__doc__rrrr!r#r'r+r.�rrrrs/���&�+�/�0�,� �� rrc��eZdZdZd�Zy)�UnsetzG
    An as-of-yet unset attribute or unprovided default parameter.
    c��y)Nz<unset>r3r&s rr.zUnset.__repr__3s��rN)r/r0r1r2r.r3rrr5r5.s���rr5c��tjt�jd|�d��}|j	d��}tj|�S)zC
    Load a schema from ./schemas/``name``.json and return it.
    zschemas/z.jsonzutf-8)�encoding)r	�files�__package__�joinpath�	read_text�json�loads)�name�path�datas   r�load_schemarB7sE��
�?�?�;�'�0�0�8�D�6��1G�H�D��>�>�7�>�+�D��:�:�d��rc�F�|s|S|�ddjd�|D���d�S)aA
    Construct a single string containing indexing operations for the indices.

    For example for a container ``bar``, [1, 2, "foo"] -> bar[1][2]["foo"]

    Arguments:

        container (str):

            A word to use for the thing being indexed

        indices (sequence):

            The indices to format.
    �[z][c3�2K�|]}t|����y�wr
�r-)�.0�indexs  r�	<genexpr>z"format_as_index.<locals>.<genexpr>Ts����#E�E�D��K�#E����])�join)�	container�indicess  r�format_as_indexrOAs0��"����[��$�)�)�#E�W�#E�E�F�a�H�Hrc#��K�|jdi�}dj|jdi��}|D]$}||vs�|rtj||�r�!|���&y�w)z�
    Return the set of additional properties for the given ``instance``.

    Weeds out properties that should have been validated by ``properties`` and
    / or ``patternProperties``.

    Assumes ``instance`` is dict-like already.
    �
properties�|�patternPropertiesN)�getrL�re�search)�instance�schemarQ�patterns�propertys     r�find_additional_propertiesr[Wsa�������L�"�-�J��x�x��
�
�#6��;�<�H�����:�%��B�I�I�h��9���N�	�s�=A � A c�n�t|�dk(rd}nd}djd�t|�D��|fS)z@
    Create an error message for extra items or properties.
    ��was�werez, c3�2K�|]}t|����y�wr
rF)rG�extras  rrIzextras_msg.<locals>.<genexpr>ss����=�U�T�%�[�=�rJ)r*rL�sorted)�extras�verbs  r�
extras_msgrejs8��
�6�{�a�������9�9�=�f�V�n�=�=�t�C�Crc�,�t|t�r|gS|S)z]
    Wrap ``thing`` in a list if it's a single str.

    Otherwise, return it unchanged.
    )�
isinstance�str)�things r�ensure_listrjvs���%����w���Lrc�x��t|�t��k7ryt�fd�|j�D��S)zI
    Check if two mappings are equal using the semantics of `equal`.
    Fc3�N�K�|]\}}|�vxrt|�|����y�wr
��equal)rG�keyr �twos   �rrIz!_mapping_equal.<locals>.<genexpr>�s4�������C��	�s�
�-�u�U�C��H�-�-��s�"%)r*�all�items��onerps `r�_mapping_equalru�s8����3�x�3�s�8������)�)�+���rc�j�t|�t|�k7rytd�t||�D��S)zJ
    Check if two sequences are equal using the semantics of `equal`.
    Fc3�:K�|]\}}t||����y�wr
rm)rG�i�js   rrIz"_sequence_equal.<locals>.<genexpr>�s����5�t�q�!�u�Q��{�5�s�)r*rq�ziprss  r�_sequence_equalr{�s.���3�x�3�s�8����5�s�3��}�5�5�5rc�*�t|t�st|t�r||k(St|t�rt|t�rt||�St|t�rt|t�rt||�St
|�t
|�k(S)z�
    Check if two things are equal evading some Python type hierarchy semantics.

    Specifically in JSON Schema, evade `bool` inheriting from `int`,
    recursing into sequences to do the same.
    )rgrhrr{rru�unboolrss  rrnrn�st���#�s��z�#�s�3��c�z���#�x� �Z��X�%>��s�C�(�(��#�w��J�s�G�$<��c�3�'�'��#�;�&��+�%�%rc��|dur|S|dur|S|S)zH
    A hack to make True and 1 and False and 0 unique for ``uniq``.
    TFr3)�element�true�falses   rr}r}�s"��
�$����	�E�	����Nrc�@�	td�|D��}tj|dd�}t||�D]\}}t	||�s�y	y#t
tf$r?g}|D]5}t|�}|D]}t	||�s�Yy|j|��7YywxYw)z�
    Check if all of a container's elements are unique.

    Tries to rely on the container being recursively sortable, or otherwise
    falls back on (slow) brute force.
    c3�2K�|]}t|����y�wr
)r})rGrxs  rrIzuniq.<locals>.<genexpr>�s����3�A�f�Q�i�3�rJr]NFT)	rb�	itertools�islicerzrn�NotImplementedError�	TypeErrorr}�append)rM�sort�slicedrxry�seen�es       r�uniqr��s�����3��3�3���!�!�$��4�0����f�%�	�D�A�q��Q��{��	���
 ��+�	����	�A��q�	�A��
!����A�;� �
!�
�K�K��N�	��	�s*�AA�
A�A�2B�B�B�Bc
���|j|d�rgSg}d|vrttdt|���Sd|vrg|jj|d�\}}|jj
|�	|t|||�z
}|jj�d|vr$|ttdt|d���z
}d|vrf|j|d��j|�r+|t|||d�z
}d|vr+|t|||d�z
}nd	|vr|t|||d	�z
}d
D]P}||vs�t|�D];\}}|j||��j|�s�+|j|��=�RdD]?}||vs�||D]0}	t|j||	��}
|
r�!|t|||	�z
}�2�A|S#|jj�wxYw)z�
    Get all indexes of items that get evaluated under the current schema

    Covers all keywords related to unevaluatedItems: items, prefixItems, if,
    then, else, contains, unevaluatedItems, allOf, oneOf, anyOf
    �booleanrrr�$ref�prefixItems�if�rX�then�else)�contains�unevaluatedItems��allOf�oneOf�anyOf)�is_type�list�ranger*�resolver�resolve�
push_scope�%find_evaluated_item_indexes_by_schema�	pop_scope�evolve�is_valid�	enumerater��descend)�	validatorrWrX�evaluated_indexes�scope�resolved�keyword�k�v�	subschema�errss           rr�r��sF�������+��	����&���E�!�S��]�+�,�,�
���#�,�,�4�4�V�F�^�D���x����%�%�e�,�	+��!F��8�X�"�
��
���(�(�*�����T�%��3�v�m�/D�+E�"F�G�G���v�~����6�$�<��0�9�9�(�C��!F��8�V�D�\�"�
�����!�%J��x����&��!����!�%J��x����&��!�4�0���f��!�(�+�
0���1��#�#�6�'�?�#�;�D�D�Q�G�%�,�,�Q�/�
0�0�/����f��#�G�_�
�	��I�-�-�h�	�B�C���%�)N�!�8�Y�*��%�
�����G
���(�(�*�s�:G�G-c���|j|d�rgSg}d|vrg|jj|d�\}}|jj|�	|t	|||�z
}|jj�dD]�}||vs�|j||d�rP|j
�D]=\}}|j||��j||i�s�-|j|��?|j||d�s��||j
�D]@\}}	||vs�|j|	��j||�s�0|j|��B��d|vr�|j
�D]o\}}|dj
�D]T\}
}tj|
|�s�|j|d��j||i�s�D|j|��V�qd|vr0|dj
�D]\}}	||vr�|t	|||	�z
}�dD]?}||vs�||D]0}	t|j||	��}|r�!|t	|||	�z
}�2�Ad	|vrg|j|d	��j|�r,|t	|||d	�z
}d
|vr|t	|||d
�z
}|Sd|vr|t	|||d�z
}|S#|jj�wxYw)a
    Get all keys of items that get evaluated under the current schema

    Covers all keywords related to unevaluatedProperties: properties,
    additionalProperties, unevaluatedProperties, patternProperties,
    dependentSchemas, allOf, oneOf, anyOf, if, then, else
    r�r�)rQ�additionalProperties�unevaluatedPropertiesr��objectrS�dependentSchemasr�r�r�r�)r�r�r�r��&find_evaluated_property_keys_by_schemar�rrr�r�r�rUrVr�r�)
r�rWrX�evaluated_keysr�r�r�rZr r��pattern�_r�s
             rr�r�s��������+��	��N�
���#�,�,�4�4�V�F�^�D���x����%�%�e�,�	+��D��8�X��
�N�
���(�(�*��8���f��� � ����)�<�'/�~�~�'7�8�O�H�e� �'�'�v�g��'�?�H�H�!�5�)��'�-�-�h�7�	8�� � ����(�;�+1�'�?�+@�+@�+B�8�'�H�i��8�+�	�0@�0@�(�1A�1��h�x��1�2�13�'�-�-�h�7�	8�8�$�f�$�'�~�~�/�	4�O�H�e�$�%8�9�?�?�A�
4�
����9�9�W�h�/�I�4D�4D�!�"5�6�5E�5��(�H�e�,�-�5.�#�)�)�(�3�	
4�	4��V�#�#)�*<�#=�#C�#C�#E�	��H�i��x�'���D��8�Y��
�N�	�/����f��#�G�_�
�	��I�-�-�h�	�B�C���"�&L�!�8�Y�'��N�
���v�~����6�$�<��0�9�9�(�C��D��8�V�D�\��
�N�����"H��x����#���������"H��x����#������y
���(�(�*�s�K
�
K&)�collections.abcrrr�urllib.parserr�r=rU�sys�version_info�	importlibr	�importlib_resourcesrr�r5rBrOr[rerjrur{rnr}r�r�r�r3rr�<module>r�s���=�=�!���	�
����v��#�+� �n� �>�F���I�,�&	D�	�	�6�
&�  ����	��8:�zQr

Zerion Mini Shell 1.0