
    Mh)                         d dl mZmZmZ d dlmZ d dlZd dlZ G d de          Z G d d          Z	d Z
d	 Zd
 Zd Zd Zd Zd Z e             e            fdZd Zd Zd Zd ZdS )    )MappingMutableMappingSequence)urlsplitNc                   B    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
S )URIDictz8
    Dictionary which uses normalized URIs as keys.
    c                 D    t          |                                          S N)r   geturlselfuris     Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jsonschema/_utils.py	normalizezURIDict.normalize   s    }}##%%%    c                 P    t                      | _         | j        j        |i | d S r
   )dictstoreupdate)r   argskwargss      r   __init__zURIDict.__init__   s-    VV

4*6*****r   c                 B    | j         |                     |                   S r
   r   r   r   s     r   __getitem__zURIDict.__getitem__   s    z$..--..r   c                 @    || j         |                     |          <   d S r
   r   )r   r   values      r   __setitem__zURIDict.__setitem__   s     */
4>>#&&'''r   c                 <    | j         |                     |          = d S r
   r   r   s     r   __delitem__zURIDict.__delitem__   s    Jt~~c**+++r   c                 *    t          | j                  S r
   )iterr   r   s    r   __iter__zURIDict.__iter__       DJr   c                 *    t          | j                  S r
   )lenr   r#   s    r   __len__zURIDict.__len__   s    4:r   c                 *    t          | j                  S r
   )reprr   r#   s    r   __repr__zURIDict.__repr__"   r%   r   N)__name__
__module____qualname____doc__r   r   r   r   r    r$   r(   r+    r   r   r   r      s         & & &+ + +/ / /0 0 0, , ,                r   r   c                       e Zd ZdZd ZdS )UnsetzG
    An as-of-yet unset attribute or unprovided default parameter.
    c                     dS )Nz<unset>r0   r#   s    r   r+   zUnset.__repr__+   s    yr   N)r,   r-   r.   r/   r+   r0   r   r   r2   r2   &   s-             r   r2   c                 T    |s| S |  dd                     d |D                        dS )aB  
    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][c              3   4   K   | ]}t          |          V  d S r
   r*   ).0indexs     r   	<genexpr>z"format_as_index.<locals>.<genexpr>B   s(      #E#EEDKK#E#E#E#E#E#Er   ])join)	containerindicess     r   format_as_indexr?   /   sD    "  HH$))#E#EW#E#E#EEEHHHHr   c              #      K   |                     di           }d                    |                     di                     }| D ]"}||vr|rt          j        ||          r|V  #dS )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)getr<   research)instanceschemarA   patternspropertys        r   find_additional_propertiesrK   E   s       L"--Jxx

#6;;<<H  :%% BIh99 NNN	 r   c                 r    t          |           dk    rdnd}d                    d | D                       |fS )z@
    Create an error message for extra items or properties.
       waswerez, c              3   4   K   | ]}t          |          V  d S r
   r7   )r8   extras     r   r:   zextras_msg.<locals>.<genexpr>\   s(      55UT%[[555555r   )r'   r<   )extrasverbs     r   
extras_msgrT   W   sC     KK1$$55&D9955f55555t;;r   c                 6    t          | t                    r| gS | S )z]
    Wrap ``thing`` in a list if it's a single str.

    Otherwise, return it unchanged.
    )
isinstancestr)things    r   ensure_listrY   _   s"     % wLr   c                     t          |           t                    k    rdS t          fd|                                 D                       S )zI
    Check if two mappings are equal using the semantics of `equal`.
    Fc              3   R   K   | ]!\  }}|v ot          ||                   V  "d S r
   equal)r8   keyr   twos      r   r:   z!_mapping_equal.<locals>.<genexpr>p   sR        C 	s
-uUCH--     r   )r'   allitemsoner_   s    `r   _mapping_equalrd   j   sa     3xx3s88u    ))++     r   c                     t          |           t          |          k    rdS t          d t          | |          D                       S )zJ
    Check if two sequences are equal using the semantics of `equal`.
    Fc              3   <   K   | ]\  }}t          ||          V  d S r
   r\   )r8   ijs      r   r:   z"_sequence_equal.<locals>.<genexpr>|   s.      55tq!uQ{{555555r   )r'   r`   ziprb   s     r   _sequence_equalrj   v   sE     3xx3s88u55s3}}555555r   c                    | |u rdS t          | t                    st          |t                    r| |k    S t          | t                    r%t          |t                    rt          | |          S t          | t                    r%t          |t                    rt          | |          S t          |           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.
    T)rV   rW   r   rj   r   rd   unboolrb   s     r   r]   r]      s     czzt#s z#s33 cz#x   )ZX%>%> )sC(((#w (JsG$<$< (c3'''#;;&++%%r   c                     | du r|S | du r|S | S )zH
    A hack to make True and 1 and False and 0 unique for ``uniq``.
    TFr0   )elementtruefalses      r   rl   rl      s'     $	E		Nr   c                 r   	 t          d | D                       }t          j        |dd          }t          ||          D ]\  }}t	          ||          r dS n\# t
          t          f$ rH g }| D ]@}t          |          }|D ]}t	          ||          r  Y dS |                    |           AY nw xY wdS )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.
    c              3   4   K   | ]}t          |          V  d S r
   )rl   )r8   rg   s     r   r:   zuniq.<locals>.<genexpr>   s(      33AfQii333333r   rM   NFT)	sorted	itertoolsisliceri   r]   NotImplementedError	TypeErrorrl   append)r=   sortslicedrg   rh   seenes          r   uniqr}      s	   3333333!$400f%% 	 	DAqQ{{ uu	  + 	 	 	 	 	Aq		A ! !A;; ! 5555! KKNNNN	 		 4s   AA A <B4B43B4c           	      X   |                      |d          rg S g }d|v r)t          t          t          |                              S |                    d          }|b| j                            |          }|                    t          | 	                    |j
        |j                  ||j
                             |                    d          }|b| j                            |          }|                    t          | 	                    |j
        |j                  ||j
                             d|v r2|t          t          t          |d                                       z  }d|v r| 	                    |d         	                              |          r9|t          | ||d                   z  }d
|v r|t          | ||d
                   z  }nd|v r|t          | ||d                   z  }dD ]_}||v rYt          |          D ]I\  }}	| 	                    ||         	                              |	          r|                    |           J`dD ]K}||v rE||         D ]<}
t          |                     ||
          d          }||t          | ||
          z  }=L|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
    booleanra   $refNrH   	_resolver$dynamicRefprefixItemsifrH   thenelse)containsunevaluatedItemsallOfoneOfanyOf)is_typelistranger'   rD   r   lookupextend%find_evaluated_item_indexes_by_schemaevolvecontentsresolveris_valid	enumeraterx   nextdescend)	validatorrG   rH   evaluated_indexesrefresolved
dynamicRefkeywordkv	subschemaerrss               r   r   r      s0    ++ 	&E#h--(()))
**V

C
&--c22  1  #,&/ !   ! 		
 		
 		
 M**J&--j99  1  #,&/ !   ! 		
 		
 		
 T%F=,A(B(B"C"CDDDv~~6$<0099(CC 	!F8VD\" "  !%Jx& & ! v!F8VF^" "  4 0 0f!(++ 0 01##6'?#;;DDQGG 0%,,Q///.  f#G_  	I--h	BBDII<%)N!8Y* * % r   c                                           |d          rg S g }|                    d          }|b j                            |          }|                    t                               |j        |j                  ||j                             |                    d          }|b j                            |          }|                    t                               |j        |j                  ||j                             |                    d          }                      |d          r,||	                                |	                                z  z  }dD ]>}|                    |          x| fd	|
                                D             z  }?d
|v r:|D ]7}	|d
         D ],}
t          j        |
|	          r|                    |	           -8d|v r9|d         
                                D ]\  }	|	|vr
|t           |          z  }dD ]S}|                    |g           D ]:t                               |                    s&|t           |          z  };Td|v r                     |d                                       |          r9|t           ||d                   z  }d|v r|t           ||d                   z  }nd|v r|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   Nr   r   rA   object)additionalPropertiesunevaluatedPropertiesc              3   h   K   | ],\  }}t                              |                    (|V  -d S r
   )r   r   )r8   r^   r   r   r   s      r   r:   z9find_evaluated_property_keys_by_schema.<locals>.<genexpr>4  sY       
 
U	))%;;<<

 
 
 
 
 
r   rC   dependentSchemasr   r   r   r   r   )r   rD   r   r   r   &find_evaluated_property_keys_by_schemar   r   r   keysra   rE   rF   rx   r   r   )r   rG   rH   evaluated_keysr   r   r   rA   r   rJ   patternr   s   `          @r   r   r     s    ++ 	N
**V

C
&--c222  #,&/ !   ! 		
 		
 		
 M**J&--j992  #,&/ !   ! 		
 		
 		
 L))JX.. >*//++hmmoo==D 
 
G,,,I5 
 
 
 
 
&nn..
 
 
 	
 f$$  	4 	4H!"56 4 49Wh// 4"))(3334 V###)*<#=#C#C#E#E 	 	Hix''D8Y  NN /  GR00 	 	II--h	BBCC D8Y  NN	 v~~6$<0099(CC 	D8VD\  N "Hx# #  vD8VF^  N r   c                 &    t          | d          du S )z2Whether there are no errors in the given iterator.N)r   )errs_its    r   r   r   a  s    $&&r   )collections.abcr   r   r   urllib.parser   rt   rE   r   r2   r?   rK   rT   rY   rd   rj   r]   r   rl   r}   r   r   r   r0   r   r   <module>r      s}   = = = = = = = = = = ! ! ! ! ! !     				         n      >       I I I,  $< < <  	 	 	6 6 6& & &$        8J J JZY Y Yx' ' ' ' 'r   