
    Ch)                         S SK JrJrJr  S SKJr  S SKrS SKr " S S\5      r " S S5      r	S r
S	 rS
 rS rS rS rS r\" 5       \" 5       4S jrS rS rS rS rg)    )MappingMutableMappingSequence)urlsplitNc                   H    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSrg)URIDict   z0
Dictionary which uses normalized URIs as keys.
c                 4    [        U5      R                  5       $ N)r   geturlselfuris     dC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\jsonschema/_utils.py	normalizeURIDict.normalize   s    }##%%    c                 Z    [        5       U l        U R                  R                  " U0 UD6  g r   )dictstoreupdate)r   argskwargss      r   __init__URIDict.__init__   s"    V


4*6*r   c                 >    U R                   U R                  U5         $ r   r   r   r   s     r   __getitem__URIDict.__getitem__   s    zz$..-..r   c                 >    X R                   U R                  U5      '   g r   r   )r   r   values      r   __setitem__URIDict.__setitem__   s    */

4>>#&'r   c                 <    U R                   U R                  U5      	 g r   r   r   s     r   __delitem__URIDict.__delitem__   s    JJt~~c*+r   c                 ,    [        U R                  5      $ r   )iterr   r   s    r   __iter__URIDict.__iter__       DJJr   c                 ,    [        U R                  5      $ r   )lenr   r)   s    r   __len__URIDict.__len__   s    4::r   c                 ,    [        U R                  5      $ r   )reprr   r)   s    r   __repr__URIDict.__repr__"   r,   r   )r   N)__name__
__module____qualname____firstlineno____doc__r   r   r   r"   r%   r*   r/   r3   __static_attributes__ r   r   r   r      s/    &+/0,  r   r   c                       \ rS rSrSrS rSrg)Unset&   z?
An as-of-yet unset attribute or unprovided default parameter.
c                     g)Nz<unset>r;   r)   s    r   r3   Unset.__repr__+   s    r   r;   N)r5   r6   r7   r8   r9   r3   r:   r;   r   r   r=   r=   &   s    r   r=   c                 P    U(       d  U $ U  SSR                  S U 5       5       S3$ )a"  
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   8   #    U  H  n[        U5      v   M     g 7fr   r2   ).0indexs     r   	<genexpr>"format_as_index.<locals>.<genexpr>B   s     #EWEDKKW   ])join)	containerindicess     r   format_as_indexrN   /   s0    " [$))#EW#EEFaHHr   c              #      #    UR                  S0 5      nSR                  UR                  S0 5      5      nU  H2  nXB;  d  M
  U(       a  [        R                  " X45      (       a  M.  Uv   M4     g7f)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_propertiesrZ   E   sZ      L"-Jxx

#6;<H%BIIh99N	 s   <A/-A/c                 \    [        U 5      S:X  a  SOSnSR                  S U  5       5      U4$ )z8
Create an error message for extra items or properties.
   waswerez, c              3   8   #    U  H  n[        U5      v   M     g 7fr   rD   )rE   extras     r   rG   extras_msg.<locals>.<genexpr>\   s     5fUT%[[frI   )r.   rK   )extrasverbs     r   
extras_msgrd   W   s0     K1$5&D995f55t;;r   c                 6    [        U [        5      (       a  U /$ U $ )zQ
Wrap ``thing`` in a list if it's a single str.

Otherwise, return it unchanged.
)
isinstancestr)things    r   ensure_listri   _   s     %wLr   c                 |   ^ [        U 5      [        T5      :w  a  g[        U4S jU R                  5        5       5      $ )zA
Check if two mappings are equal using the semantics of `equal`.
Fc              3   ^   >#    U  H"  u  pUT;   =(       a    [        UTU   5      v   M$     g 7fr   equal)rE   keyr!   twos      r   rG   !_mapping_equal.<locals>.<genexpr>p   s1      %JC 	s
-uUCH--%s   *-)r.   allitemsonero   s    `r   _mapping_equalru   j   s8     3x3s8 ))+  r   c                 j    [        U 5      [        U5      :w  a  g[        S [        X5       5       5      $ )zB
Check if two sequences are equal using the semantics of `equal`.
Fc              3   <   #    U  H  u  p[        X5      v   M     g 7fr   rl   )rE   ijs      r   rG   "_sequence_equal.<locals>.<genexpr>|   s     5}tquQ{{}s   )r.   rq   ziprs   s     r   _sequence_equalr|   v   s,     3x3s85s3}555r   c                 j   XL a  g[        U [        5      (       d  [        U[        5      (       a  X:H  $ [        U [        5      (       a   [        U[        5      (       a  [        X5      $ [        U [        5      (       a   [        U[        5      (       a  [        X5      $ [        U 5      [        U5      :H  $ )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)rf   rg   r   r|   r   ru   unboolrs   s     r   rm   rm      s     z#sz#s33z#x  ZX%>%>s((#wJsG$<$<c''#;&+%%r   c                 "    U SL a  U$ U SL a  U$ U $ )z@
A hack to make True and 1 and False and 0 unique for ``uniq``.
TFr;   )elementtruefalses      r   r~   r~      s"     $	E	Nr   c                 Z    [        S U  5       5      n[        R                  " USS5      n[        X5       H  u  p4[	        X45      (       d  M    g   g! [
        [        4 aG    / nU  H<  n[        U5      nU H  n[	        X65      (       d  M       g   UR                  U5        M>      gf = f)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   8   #    U  H  n[        U5      v   M     g 7fr   )r~   )rE   rx   s     r   rG   uniq.<locals>.<genexpr>   s     3AfQiirI   r\   NFT)	sorted	itertoolsislicer{   rm   NotImplementedError	TypeErrorr~   append)rL   sortslicedrx   ry   seenes          r   uniqr      s    333!!$40%DAQ{{ &   + 	Aq	A;;   KKN  	s*   AA A A 5B*B*B*)B*c           	         U R                  US5      (       a  / $ / nSU;   a  [        [        [        U5      5      5      $ UR	                  S5      nUbc  U R
                  R                  U5      nUR                  [        U R                  UR                  UR                  S9UUR                  5      5        UR	                  S5      nUbc  U R
                  R                  U5      nUR                  [        U R                  UR                  UR                  S9UUR                  5      5        SU;   a#  U[        [        [        US   5      5      5      -  nSU;   ai  U R                  US   S	9R                  U5      (       a+  U[        XUS   5      -  nS
U;   a  U[        XUS
   5      -  nOSU;   a  U[        XUS   5      -  nS HV  nXr;   d  M
  [        U5       H=  u  pU R                  X'   S	9R                  U	5      (       d  M,  UR                  U5        M?     MX     S HD  nXr;   d  M
  X'    H2  n
[        U R!                  X5      S5      nUb  M#  U[        XU
5      -  nM4     MF     U$ )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
booleanrr   $refNrW   	_resolver$dynamicRefprefixItemsifrW   thenelse)containsunevaluatedItemsallOfoneOfanyOf)is_typelistranger.   rS   r   lookupextend%find_evaluated_item_indexes_by_schemaevolvecontentsresolveris_valid	enumerater   nextdescend)	validatorrV   rW   evaluated_indexesrefresolved
dynamicRefkeywordkv	subschemaerrss               r   r   r      s    ++	&E#h-())
**V
C
&&--c2  1  #,,&// !  !!		
 M*J&&--j9  1  #,,&// !  !!		
 T%F=,A(B"CDDv~6$<099(CC!FVD\"  !%J& ! v!FVF^"  4!(+##6?#;DDQGG%,,Q/ , 4 /#_	I--hBDI<%)N!Y* % - / r   c           	        ^ ^ T R                  US5      (       a  / $ / nUR                  S5      nUbc  T R                  R                  U5      nUR	                  [        T R                  UR                  UR                  S9UUR                  5      5        UR                  S5      nUbc  T R                  R                  U5      nUR	                  [        T R                  UR                  UR                  S9UUR                  5      5        UR                  S5      nT R                  US5      (       a#  X7R                  5       UR                  5       -  -  nS H7  nUR                  U5      =mc  M  UUU 4S jUR                  5        5       -  nM9     S	U;   aC  U H=  n	US	    H1  n
[        R                  " X5      (       d  M   UR                  U	5        M3     M?     S
U;   a4  US
   R                  5        H  u  n	mX;  a  M  U[        T UT5      -  nM     S HN  nUR                  U/ 5       H5  m[        T R                  UT5      5      (       d  M%  U[        T UT5      -  nM7     MP     SU;   aj  T R                  US   S9R                  U5      (       a,  U[        T XS   5      -  nSU;   a  U[        T XS   5      -  nU$ SU;   a  U[        T XS   5      -  nU$ )z
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   r   r   rP   object)additionalPropertiesunevaluatedPropertiesc              3   p   >#    U  H+  u  p[        TR                  UT5      5      (       d  M'  Uv   M-     g 7fr   )r   r   )rE   rn   r!   r   r   s      r   rG   9find_evaluated_property_keys_by_schema.<locals>.<genexpr>4  s1      
.
	))%;< C.s   &6	6rR   dependentSchemasr   r   r   r   r   )r   rS   r   r   r   &find_evaluated_property_keys_by_schemar   r   r   keysrr   rT   rU   r   r   r   )r   rV   rW   evaluated_keysr   r   r   rP   r   rY   patternr   s   `          @r   r   r     s    ++	N
**V
C
&&--c22  #,,&// !  !!		
 M*J&&--j92  #,,&// !  !!		
 L)JX..//+hmmo==DG,,I5 
&nn.
 	
 E f$ H!"5699W//"))(3 7 !
 V##)*<#=#C#C#EHi'D8Y N $F /GR0II--h	BCCD8Y N 1 / v~6$<099(CCD8D\ N "Hx#   vD8F^ N r   c                     [        U S5      SL $ )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   r   rT   r   r=   rN   rZ   rd   ri   ru   r|   rm   r   r~   r   r   r   r   r;   r   r   <module>r      sv    = = !  	 n  > I,$<	6&$   8JZYx'r   