HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/referencing/__pycache__/jsonschema.cpython-39.pyc
a

�,�h�H�
@sUdZddlmZddlmZmZmZddlmZm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZddlmZmZmZeeefZe	eefZ e
e Z!ee Z"e�Z#d	e$d
<eGdd�de%��Z&d
dd�dd�Z'd
dd�dd�Z(ddd�dd�Z)dd
dd�dd�Z*dd
dd�dd�Z+dd
dd�dd �Z,d!dd"d�d#d$�Z-e.�e.�e.�fd%d%d%d&�d'd(�Z/e.�e.�e.�fd%d%d%d&�d)d*�Z0e.�e.�e.�fd%d%d%d&�d+d,�Z1e.�e.�e.�fd%d%d%d&�d-d.�Z2e.�e.�e.�fd%d%d%d&�d/d0�Z3e.�e.�e.�fd%d%d%d&�d1d2�Z4e.�e.�e.�fd%d%d%d&�d3d4�Z5ed5e'e/hd6�hd7�hd8�d9�e*e3hd6�hd7�hd8�d9�d:�Z6ed;e'e0hd<�hd=�hd8�d9�e+e4hd<�hd=�hd8�d9�d:�Z7ed>e(e1hd?�hd=�hd@�d9�e,e5hd?�hd=�hd@�d9�d:�Z8edAe(e1hdB�hd=�hd@�d9�e,e5hdB�hd=�hd@�d9�d:�Z9edCe)e2dDhhd=�hd@�d9�e-e5hdE�hd=�hd@�d9�d:�Z:edFe)e2dGhhd@�dH�e-e5dIdJhdGhhd@�d9�d:�Z;edKdL�dMe6fdNe7fdOe8fdPe9fdQe:fdRe;ffD��Z<dSe$dT<efdUdVdWdX�dYdZ�Z=eGd[d\�d\��Z>d]d^d_�d`da�Z?dbS)czI
Referencing implementations for JSON Schema specs (historic & current).
�)�annotations)�Iterable�Sequence�Set)�Any�Union)�Anchor�Registry�Resource�
Specification�
exceptions)�frozen)�_UNSET�Resolved�Resolver�_Unset)�URIr�Mapping�SchemaRegistry�EMPTY_REGISTRYc@seZdZUdZded<dS)�UnknownDialectz�
    A dialect identifier was found for a dialect unknown by this library.

    If it's a custom ("unofficial") dialect, be sure you've registered it.
    r�uriN)�__name__�
__module__�__qualname__�__doc__�__annotations__�rr�G/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/referencing/jsonschema.pyr$s
r�Schemaz
URI | None��contents�returncCst|t�rdS|�d�S)N�$id)�
isinstance�bool�get)r!rrr�
_dollar_id/s
r'cCs:t|t�sd|vrdS|�d�}|dur6|�d�s6|SdS)N�$refr#�#)r$r%r&�
startswith�r!�idrrr�_legacy_dollar_id5s

r-�ObjectSchemacCs0d|vrdS|�d�}|dur,|�d�s,|SdS)Nr(r,r))r&r*r+rrr�
_legacy_id=s

r/zSpecification[Schema]zIterable[AnchorType[Schema]])�
specificationr!r"ccs^t|t�rdS|�d�}|dur4t||�|�d�V|�d�}|durZt||�|�d�VdS)N�$anchor��name�resourcez$dynamicAnchor)r$r%r&r�create_resource�
DynamicAnchor)r0r!�anchorZdynamic_anchorrrr�_anchorEs

�
�r8zIterable[Anchor[Schema]]cCs8t|t�rgS|�d�}|dur$gSt||�|�d�gS)Nr1r2)r$r%r&rr5)r0r!r7rrr�_anchor_2019Zs

��r9cCsDt|t�rgS|�dd�}|�d�s(gSt|dd�|�|�d�gS)Nr#�r)�r2)r$r%r&r*rr5�r0r!r,rrr�_legacy_anchor_in_dollar_idks


��r=zSpecification[ObjectSchema]zIterable[Anchor[ObjectSchema]]cCs6|�dd�}|�d�sgSt|dd�|�|�d�gS)Nr,r:r)r;r2)r&r*rr5r<rrr�_legacy_anchor_in_id|s

��r>zSet[str])�in_value�in_subvalues�in_subarraycsddd����fdd�}|S)z�
    Create a callable returning JSON Schema specification-style subschemas.

    Relies on specifying the set of keywords containing subschemas in their
    values, in a subobject's values, or in a subarray.
    r�Iterable[ObjectSchema]r c3srt|t�rdS�D]}||vr||Vq�D]}||vr.||EdHq.�D]}||vrN||��EdHqNdS�N)r$r%�values)r!�each�rAr@r?rr�subresources_of�s
z)_subresources_of.<locals>.subresources_ofr�r?r@rArGrrFr�_subresources_of�s
rIcsddd����fdd�}|S)�O
    Specifically handle older drafts where there are some funky keywords.
    rrBr c3s�t|t�rdS�D]}||vr||Vq�D]}||vr.||EdHq.�D]}||vrN||��EdHqN|�d�}|dur�t|t�r�|EdHn|VdS�N�items)r$r%rDr&r)r!rErLrFrrrG�s 


z:_subresources_of_with_crazy_items.<locals>.subresources_ofrrHrrFr�!_subresources_of_with_crazy_items�s	rMcsddd����fdd�}|S)rJrrBr c3s�t|t�rdS�D]}||vr||Vq�D]}||vr.||EdHq.�D]}||vrN||��EdHqN|�d�}|dur�t|t�r�|EdHn|V|�d�}|dur�t|���}t|d�}t|t�r�|V|EdHdS)NrL�dependencies)r$r%rDr&r�iter�nextr�r!rErLrNrD�valuerFrrrG�s.





zG_subresources_of_with_crazy_items_dependencies.<locals>.subresources_ofrrHrrFr�._subresources_of_with_crazy_items_dependencies�s	rScsddd����fdd�}|S)zT
    Specifically handle even older drafts where there are some funky keywords.
    r.rBr c3s��D]}||vr||Vq�D]}||vr ||EdHq �D]}||vr@||��EdHq@|�d�}|dur�t|t�r�|EdHn|V|�d�}|dur�t|���}t|d�}t|t�r�|V|EdHdD]}|�|�}t|t�r�|Vq�dS)NrLrN)�additionalItems�additionalProperties)rDr&r$rrOrPrrQrFrrrG�s2







zJ_subresources_of_with_crazy_aP_items_dependencies.<locals>.subresources_ofrrHrrFr�1_subresources_of_with_crazy_aP_items_dependencies�s	rVcs&||B�ddddd���fdd�}|S)N�Sequence[int | str]�_Resolver[Any]�
Resource[Any]��segments�resolver�subresourcer"csBt|�}|D]*}|�vr|�vs.t|d�dur|Sq|�|�SrC)rOrP�in_subresource�r[r\r]Z	_segments�segment�Zin_childr?rr�maybe_in_subresources��
z3_maybe_in_subresource.<locals>.maybe_in_subresourcer�r?r@rArbrrar�_maybe_in_subresources
rdcs&||B�ddddd���fdd�}|S)NrWrXrYrZcsdt|�}|D]L}|dkr2t|jt�r2|�|�S|�vr|�vsPt|d�dur|Sq|�|�SrK�rOr$r!rr^rPr_rarrrb6s
���
z?_maybe_in_subresource_crazy_items.<locals>.maybe_in_subresourcerrcrrar�!_maybe_in_subresource_crazy_items/srfcs&||B�ddddd���fdd�}|S)NrWrXrYrZcsdt|�}|D]L}|dvr2t|jt�r2|�|�S|�vr|�vsPt|d�dur|Sq|�|�S)N>rNrLrer_rarrrbRs
���
zL_maybe_in_subresource_crazy_items_dependencies.<locals>.maybe_in_subresourcerrcrrar�._maybe_in_subresource_crazy_items_dependenciesKsrgzdraft2020-12>�notrU�unevaluatedItems�contains�ifrL�then�
propertyNames�
contentSchema�else�unevaluatedProperties>�allOf�anyOfZprefixItems�oneOf>�patternProperties�
properties�definitionsz$defsZdependentSchemas)r?rAr@)r3Zid_ofrGZ
anchors_inrbzdraft2019-09>rhrUrirjrkrlrmrnrorprT>rqrrrszdraft-07>rhrUrjrkrlrmrorT>rvrurtzdraft-06>rhrUrjrmrTzdraft-04rh>rhrTrUzdraft-03Zextends)rAr@rTrUcCsi|]\}}|t�|��qSr)r
�opaque)�.0�
dialect_idr0rrr�
<dictcomp>/s�rzz,https://json-schema.org/draft/2020-12/schemaz,https://json-schema.org/draft/2019-09/schemaz&http://json-schema.org/draft-07/schemaz&http://json-schema.org/draft-06/schemaz&http://json-schema.org/draft-04/schemaz&http://json-schema.org/draft-03/schemazRegistry[Specification[Schema]]�_SPECIFICATIONSrzSpecification[Any] | _UnsetzSpecification[Any])ry�defaultr"cCs2t�|�d��}|dur|jS|tur.t|��|S)z�
    Retrieve the `Specification` with the given dialect identifier.

    Raises:

        `UnknownDialect`

            if the given ``dialect_id`` isn't known

    r)N)r{r&�rstripr!rr)ryr|r4rrr�specification_with=sr~c@s2eZdZUdZded<ded<ddd�d	d
�ZdS)r6z4
    Dynamic anchors, introduced in draft 2020.
    �strr3�SchemaResourcer4�_Resolver[Schema]�_Resolved[Schema]�r\r"c	Csj|j}|��D]F\}}z|�||j�j}WntjyBYqYn0t|t�r|j}qt	|j
|�|�d�S)z2
        Resolve this anchor dynamically.
        )r!r\)r4�
dynamic_scoper7r3rRrZNoSuchAnchorr$r6�	_Resolvedr!r^)�selfr\�lastr�registryr7rrr�resolve\s

�zDynamicAnchor.resolveN)rrrrrr�rrrrr6Ss
r6r�r�r�cCsb|�d�}t|jt�r^|j�d�r^|��D]2\}}|�|�}t|jt�rT|j�d�sXq^|}q*|S)u�
    Recursive references (via recursive anchors), present only in draft 2019.

    As per the 2019 specification (§ 8.2.4.2.1), only the ``#`` recursive
    reference is supported (and is therefore assumed to be the relevant
    reference).
    r)z$recursiveAnchor)�lookupr$r!rr&r�)r\�resolvedr�_Z
next_resolvedrrr�lookup_recursive_refns
�
�
�r�N)@r�
__future__r�collections.abcrrr�typingrrZreferencingrr	r
rrZreferencing._attrsr
Zreferencing._corerrr�rZ	_ResolverrZreferencing.typingrZ
AnchorTyperrr.r%rr�rrr�	Exceptionrr'r-r/r8r9r=r>�	frozensetrIrMrSrVrdrfrgZDRAFT202012ZDRAFT201909ZDRAFT7ZDRAFT6ZDRAFT4ZDRAFT3r{r~r6r�rrrr�<module>s4
��!�(�+���
�
��4
�
��4
�
��"�������������