Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/local/lib/python3.6/site-packages/jsonschema/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.6/site-packages/jsonschema/__pycache__/_utils.cpython-36.pyc
3

F�Kd�'�@s�ddlmZmZmZddlmZddlZddlZddlZddl	Z	Gdd�de�Z
Gdd�de�Zdd	�Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Ze�e�fdd�Zdd�Zdd�Zdd�ZdS) �)�Mapping�MutableMapping�Sequence)�urlsplitNc@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�URIDictz8
    Dictionary which uses normalized URIs as keys.
    cCst|�j�S)N)r�geturl)�self�uri�r
�7/tmp/pip-build-8nxjc3nm/jsonschema/jsonschema/_utils.py�	normalizeszURIDict.normalizecOst�|_|jj||�dS)N)�dict�store�update)r�args�kwargsr
r
r�__init__szURIDict.__init__cCs|j|j|�S)N)rr)rr	r
r
r�__getitem__szURIDict.__getitem__cCs||j|j|�<dS)N)rr)rr	�valuer
r
r�__setitem__szURIDict.__setitem__cCs|j|j|�=dS)N)rr)rr	r
r
r�__delitem__szURIDict.__delitem__cCs
t|j�S)N)�iterr)rr
r
r�__iter__szURIDict.__iter__cCs
t|j�S)N)�lenr)rr
r
r�__len__!szURIDict.__len__cCs
t|j�S)N)�reprr)rr
r
r�__repr__$szURIDict.__repr__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr
r
r
rr	src@seZdZdZdd�ZdS)�UnsetzG
    An as-of-yet unset attribute or unprovided default parameter.
    cCsdS)Nz<unset>r
)rr
r
rr-szUnset.__repr__N)rrrr rr
r
r
rr!(sr!cCs"tjddj|��}tj|jd��S)zC
    Load a schema from ./schemas/``name``.json and return it.
    Z
jsonschemazschemas/{0}.jsonzutf-8)�pkgutil�get_data�format�json�loads�decode)�name�datar
r
r�load_schema1sr*cCs(|s|S|�ddjdd�|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][css|]}t|�VqdS)N)r)�.0�indexr
r
r�	<genexpr>Msz"format_as_index.<locals>.<genexpr>�])�join)�	container�indicesr
r
r�format_as_index:sr3ccsP|jdi�}dj|jdi��}x,|D]$}||kr$|rBtj||�rBq$|Vq$WdS)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)�getr0�re�search)�instance�schemar4�patterns�propertyr
r
r�find_additional_propertiesPs

r>cCs.t|�dkrd}nd}djdd�|D��|fS)z@
    Create an error message for extra items or properties.
    �ZwasZwerez, css|]}t|�VqdS)N)r)r,�extrar
r
rr.lszextras_msg.<locals>.<genexpr>)rr0)�extrasZverbr
r
r�
extras_msgcsrBcCst|t�r|gS|S)z]
    Wrap ``thing`` in a list if it's a single str.

    Otherwise, return it unchanged.
    )�
isinstance�str)�thingr
r
r�ensure_listos
rFcs.t|�t��krdSt�fdd�|j�D��S)zI
    Check if two mappings are equal using the semantics of `equal`.
    Fc3s(|] \}}|�kot|�|�VqdS)N)�equal)r,�keyr)�twor
rr.�sz!_mapping_equal.<locals>.<genexpr>)r�all�items)�onerIr
)rIr�_mapping_equal{s

rMcCs,t|�t|�krdStdd�t||�D��S)zJ
    Check if two sequences are equal using the semantics of `equal`.
    Fcss|]\}}t||�VqdS)N)rG)r,�i�jr
r
rr.�sz"_sequence_equal.<locals>.<genexpr>)rrJ�zip)rLrIr
r
r�_sequence_equal�srQcCsht|t�st|t�r||kSt|t�r:t|t�r:t||�St|t�rXt|t�rXt||�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.
    )rCrDrrQrrM�unbool)rLrIr
r
rrG�s

rGcCs|dkr|S|dkr|S|S)zH
    A hack to make True and 1 and False and 0 unique for ``uniq``.
    TFr
)�element�true�falser
r
rrR�s
rRcCs�yFtdd�|D��}tj|dd�}x t||�D]\}}t||�SWWnXttfk
r�g}x:|D]2}t|�}x|D]}t||�rvdSqvW|j	|�qdWYnXdS)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.
    css|]}t|�VqdS)N)rR)r,rNr
r
rr.�szuniq.<locals>.<genexpr>r?NFT)
�sorted�	itertools�islicerPrQ�NotImplementedError�	TypeErrorrRrG�append)r1�sortZslicedrNrO�seen�er
r
r�uniq�s


r_cCs�|j|d�rgSg}d|kr.ttdt|���Sd|krx|jj|d�\}}|jj|�z|t|||�7}Wd|jj�Xd|kr�|ttdt|d���7}d|k�r
|j	|dd�j
|�r�|t|||d�7}d	|kr�|t|||d	�7}nd
|k�r
|t|||d
�7}xRdD]J}||k�rx8t|�D],\}}|j	||d�j
|��r(|j|��q(W�qWxRdD]J}||k�rdx8||D],}	t|j
||	��}
|
�s||t|||	�7}�q|W�qdW|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
    �booleanrKrz$refNZprefixItems�if)r;�then�else�contains�unevaluatedItems�allOf�oneOf�anyOf)rdre)rfrgrh)�is_type�list�ranger�resolver�resolve�
push_scope�%find_evaluated_item_indexes_by_schema�	pop_scope�evolve�is_valid�	enumerater[�descend)�	validatorr:r;Zevaluated_indexes�scope�resolved�keyword�k�v�	subschema�errsr
r
rro�sJ





roc
Cs�|j|d�rgSg}d|kr^|jj|d�\}}|jj|�z|t|||�7}Wd|jj�Xx�dD]�}||krd|j||d�r�x8|j�D],\}}|j||d�j||i�r�|j	|�q�W|j||d�rdx@||j�D]0\}}	||kr�|j|	d�j||�r�|j	|�q�WqdWd	|k�r�xf|j�D]Z\}}xN|d	j�D]>\}
}t
j|
|��r:|j|d	d�j||i��r:|j	|��q:W�q$Wd
|k�r�x8|d
j�D](\}}	||k�r��q�|t|||	�7}�q�WxRdD]J}||k�r�x8||D],}	t|j
||	��}|�s�|t|||	�7}�q�W�q�Wd|k�r�|j|dd�j|��rp|t|||d�7}d|k�r�|t|||d�7}nd|k�r�|t|||d�7}|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`z$refNr4�additionalProperties�unevaluatedProperties)r;�objectr6ZdependentSchemasrfrgrhrarbrc)r4r}r~)rfrgrh)rirlrmrn�&find_evaluated_property_keys_by_schemarprKrqrrr[r8r9rjrt)
rur:r;Zevaluated_keysrvrwrxr=rr{�pattern�_r|r
r
rr�sn









r�)�collections.abcrrr�urllib.parserrWr%r"r8rrr!r*r3r>rBrFrMrQrGrRr_ror�r
r
r
r�<module>s&			<

haha - 2025