HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/root/usr/lib/python3/dist-packages/jsonschema/__pycache__/
Upload File :
Current File : //proc/1991111/root/usr/lib/python3/dist-packages/jsonschema/__pycache__/_utils.cpython-311.pyc
�

�r�c�(���ddlmZmZmZddlmZddlZddlZddlZddl	Z	e	j
dkrddlmZnddl
ZGd�de��ZGd�d	e��Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Ze��e��fd�Zd�Zd�Zd�ZdS)�)�Mapping�MutableMapping�Sequence)�urlsplitN)��	)�	resourcesc�B�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
S)�URIDictz8
    Dictionary which uses normalized URIs as keys.
    c�D�t|�����S�N)r�geturl��self�uris  �3/usr/lib/python3/dist-packages/jsonschema/_utils.py�	normalizezURIDict.normalizes����}�}�#�#�%�%�%�c�P�t��|_|jj|i|��dSr
)�dict�store�update)r�args�kwargss   r�__init__zURIDict.__init__s-���V�V��
���
��4�*�6�*�*�*�*�*rc�B�|j|�|��Sr
�rrrs  r�__getitem__zURIDict.__getitem__s���z�$�.�.��-�-�.�.rc�@�||j|�|��<dSr
r)rr�values   r�__setitem__zURIDict.__setitem__s ��*/��
�4�>�>�#�&�&�'�'�'rc�<�|j|�|��=dSr
rrs  r�__delitem__zURIDict.__delitem__!s���J�t�~�~�c�*�*�+�+�+rc�*�t|j��Sr
)�iterr�rs r�__iter__zURIDict.__iter__$����D�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�0�0�,�,�,� � � ���� � � � � rrc��eZdZdZd�ZdS)�UnsetzG
    An as-of-yet unset attribute or unprovided default parameter.
    c��dS)Nz<unset>r3r&s rr.zUnset.__repr__3s���yrN)r/r0r1r2r.r3rrr5r5.s-������������rr5c��tjt���d|�d���}|�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_schemarB7sP��
�?�;�'�'�0�0�1G�D�1G�1G�1G�H�H�D��>�>�7�>�+�+�D��:�d���rc�T�|s|S|�dd�d�|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�4K�|]}t|��V��dSr
�r-)�.0�indexs  r�	<genexpr>z"format_as_index.<locals>.<genexpr>Ts(����#E�#E�E�D��K�K�#E�#E�#E�#E�#E�#Er�])�join)�	container�indicess  r�format_as_indexrNAsD��"�����H�H�$�)�)�#E�#E�W�#E�#E�#E�E�E�H�H�H�Hrc#��K�|�di��}d�|�di����}|D]"}||vr|rtj||��r�|V��#dS)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)�getrK�re�search)�instance�schemarP�patterns�propertys     r�find_additional_propertiesrZWs��������L�"�-�-�J��x�x��
�
�#6��;�;�<�<�H������:�%�%��
�B�I�h��9�9�
���N�N�N��	�rc��t|��dkrd}nd}d�d�t|��D����|fS)z@
    Create an error message for extra items or properties.
    ��was�werez, c3�4K�|]}t|��V��dSr
rF)rG�extras  rrIzextras_msg.<locals>.<genexpr>ss(����=�=�U�T�%�[�[�=�=�=�=�=�=r)r*rK�sorted)�extras�verbs  r�
extras_msgrdjsM��
�6�{�{�a���������9�9�=�=�f�V�n�n�=�=�=�=�=�t�C�Crc�6�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_listrivs"���%������w���Lrc���t|��t���krdSt�fd�|���D����S)zI
    Check if two mappings are equal using the semantics of `equal`.
    Fc3�R�K�|]!\}}|�vot|�|��V��"dSr
��equal)rG�keyr �twos   �rrIz!_mapping_equal.<locals>.<genexpr>�sR��������C��	�s�
�-�u�U�C��H�-�-������r)r*�all�items��oneros `r�_mapping_equalrt�sa����3�x�x�3�s�8�8����u�������)�)�+�+������rc��t|��t|��krdStd�t||��D����S)zJ
    Check if two sequences are equal using the semantics of `equal`.
    Fc3�<K�|]\}}t||��V��dSr
rl)rG�i�js   rrIz"_sequence_equal.<locals>.<genexpr>�s.����5�5�t�q�!�u�Q��{�{�5�5�5�5�5�5r)r*rp�ziprrs  r�_sequence_equalrz�sE���3�x�x�3�s�8�8����u��5�5�s�3��}�}�5�5�5�5�5�5rc��t|t��st|t��r||kSt|t��r%t|t��rt||��St|t��r%t|t��rt||��St
|��t
|��kS)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.
    )rfrgrrzrrt�unboolrrs  rrmrm�s����#�s����z�#�s�3�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�r�	td�|D����}tj|dd��}t||��D]\}}t	||��rdS�n\#t
tf$rHg}|D]@}t|��}|D]}t	||��rYdS�|�|���AYnwxYwdS)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�4K�|]}t|��V��dSr
)r|)rGrws  rrIzuniq.<locals>.<genexpr>�s(����3�3�A�f�Q�i�i�3�3�3�3�3�3rr\NFT)	ra�	itertools�isliceryrm�NotImplementedError�	TypeErrorr|�append)rL�sort�slicedrwrx�seen�es       r�uniqr��s	����3�3��3�3�3�3�3���!�$��4�0�0����f�%�%�	�	�D�A�q��Q��{�{�
��u�u�
�	��
 ��+�	�	�	����	�	�A��q�	�	�A��
!�
!����A�;�;�!� �5�5�5�5�!�
�K�K��N�N�N�N�	�	�	�����4s�AA�A�<B4�B4�3B4c
��|�|d��rgSg}d|vr*ttdt|������Sd|vr�|j�|d��\}}|j�|��	|t|||��z
}|j���n#|j���wxYwd|vr3|ttdt|d������z
}d|vr�|�	|d����
|��r9|t|||d��z
}d|vr|t|||d��z
}nd	|vr|t|||d	��z
}d
D]_}||vrYt|��D]I\}}|�	||����
|��r|�|���J�`dD]J}||vrD||D];}	t|�
||	����}
|
s|t|||	��z
}�<�K|S)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
    �booleanrqr�$ref�prefixItems�if�rW�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)�	validatorrVrW�evaluated_indexes�scope�resolved�keyword�k�v�	subschema�errss           rr�r��s��������+�+���	����&����E�!�S��]�]�+�+�,�,�,�
����#�,�4�4�V�F�^�D�D���x���%�%�e�,�,�,�	+��!F��8�X�"�"�
��
��(�(�*�*�*�*��I��(�(�*�*�*�*���������T�%��3�v�m�/D�+E�+E�"F�"F�G�G�G���v�~�~����6�$�<��0�0�9�9�(�C�C�	��!F��8�V�D�\�"�"�
������!�%J��x����&�&��!������!�%J��x����&�&��!�4�0�0���f���!�(�+�+�
0�
0���1��#�#�6�'�?�#�;�;�D�D�Q�G�G�0�%�,�,�Q�/�/�/���.�����f���#�G�_�
�
�	��I�-�-�h�	�B�B�C�C����%�)N�!�8�Y�*�*��%����s�B9�9Cc���|�|d��rgSg}d|vr�|j�|d��\}}|j�|��	|t	|||��z
}|j���n#|j���wxYwdD�]}||v�r|�||d��r`|���D]K\}}|�||����||i��r|�	|���L|�||d��rh||���D]M\}}	||vrD|�|	����||��r|�	|���N��
d|vr�|���D]�\}}|d���D]`\}
}tj|
|��rF|�|d����||i��r|�	|���a��d|vr9|d���D]\}}	||vr�
|t	|||	��z
}�dD]J}||vrD||D];}	t|�
||	����}|s|t	|||	��z
}�<�Kd	|vr�|�|d	����|��r9|t	|||d	��z
}d
|vr|t	|||d
��z
}nd|vr|t	|||d��z
}|S)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�)rP�additionalProperties�unevaluatedPropertiesr��objectrR�dependentSchemasr�r�r�r�)r�r�r�r��&find_evaluated_property_keys_by_schemar�rqr�r�r�rTrUr�r�)
r�rVrW�evaluated_keysr�r�r�rYr r��pattern�_r�s
             rr�r�s?�������+�+���	��N�
����#�,�4�4�V�F�^�D�D���x���%�%�e�,�,�,�	+��D��8�X���
�N�
��(�(�*�*�*�*��I��(�(�*�*�*�*�����8�8���f���� � ����)�<�<�
8�'/�~�~�'7�'7�8�8�O�H�e� �'�'�v�g��'�?�?�H�H�!�5�)���8�'�-�-�h�7�7�7��� � ����(�;�;�
8�+1�'�?�+@�+@�+B�+B�8�8�'�H�i��8�+�+�	�0@�0@�(�1A�1�1��h�x��1�2�2�,�'�-�-�h�7�7�7����f�$�$�'�~�~�/�/�	4�	4�O�H�e�$�%8�9�?�?�A�A�
4�
4�
����9�W�h�/�/�4�I�4D�4D�!�"5�6�5E�5�5��(�H�e�,�-�-�4�#�)�)�(�3�3�3��	
4��V�#�#�#)�*<�#=�#C�#C�#E�#E�	�	��H�i��x�'�'���D��8�Y���
�N�N�/�����f���#�G�_�
�
�	��I�-�-�h�	�B�B�C�C����"�&L�!�8�Y�'�'��N����v�~�~����6�$�<��0�0�9�9�(�C�C�	��D��8�V�D�\���
�N������"H��x����#�#���������"H��x����#�#����s�B�B&)�collections.abcrrr�urllib.parserr�r=rT�sys�version_info�	importlibr	�importlib_resourcesrr�r5rBrNrZrdrirtrzrmr|r�r�r�r3rr�<module>r�s���=�=�=�=�=�=�=�=�=�=�!�!�!�!�!�!���������	�	�	�	�
�
�
�
���v���#�#�#�#�#�#�#�+�+�+�+� � � � � �n� � � �>�����F�������I�I�I�,���&	D�	D�	D�	�	�	�	�	�	�6�6�6�
&�
&�
&�  ��������	�	�	�	����8:�:�:�zQ�Q�Q�Q�Qr