+
    7*ie  c                   s  a  Rf t0 t ^ RIt^ RIt^ RIt^ RIHtHtHt ^ RIH	t	 ^ RI
HtHt ^ RIHtHtHtHtHtHt ^ RIHtHtHtHtHtHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t& ^ RI'H(t( ^ RI)H*t* ^ R	I+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3 ^ R
I4H5t5 ]'       da   ^ RI6H7t7 ^ RI8H9t9 ^ RI:H;t; ^ RI<H=t= ^ RI>H?t? ^ RI@HAtA ^ RI+HBtBHCtCHDtDHEtEHFtF ]]&]]#],          ]#]G]3,          ]#]G]]3,          3,          ,          tHRgtIRtJ]K]L]M]G]N]O]P],]]]]P                  ]]]RP                  ]TP                  0tU] ^ k ]V]W]X]Y]Z]]]0t[] ^k R R lt\R^P/R R llt]R R lt^R R  lt_R! R" lt`R# R$ ltaR% R& ltbR' R( ltc]%! R)4      tdR* R+ lteR, R- ltfR.R//R0 R1 lltgR2 R3 lthR4 R5 ltiR6 R7 ltjR8 R9 ltk]%! R:4      tlR;]G/R< R= lltm ! R> R]G4      tn ! R? R4      to ! R@ R]o4      tp ! RA R]o4      tq ! RB R4      trRCRDRERFRGRHRIRJRKRLRMRNRORPRQRR/tsRS RT ltt]%! RU4      tuRV RW ltvRX RY ltw0 RhmtxRZ R[ lty]z! 4       t{R\ R] lt|R^ R_ lt}R` Ra lt~Rb Rc ltRd Re ltR# )i    N)OrderedDictdefaultdictdeque)deepcopy)islicezip_longest)BuiltinFunctionTypeCodeTypeFunctionTypeGeneratorType
LambdaType
ModuleType)TYPE_CHECKINGAbstractSetAnyCallable
CollectionDict	GeneratorIterableIteratorListMappingNoReturnOptionalSetTupleTypeTypeVarUnion)	Annotated)ConfigError)NoneTypeWithArgsTypesall_literal_valuesdisplay_as_typeget_args
get_originis_literal_typeis_union)version_info)	Signature)Path)
BaseConfig)	Dataclass)
ModelField	BaseModel)AbstractSetIntStrDictIntStrAnyIntStrMappingIntStrAnyReprArgsPyObjectStrRepresentation
GetterDict
ValueItemsClassAttributeZ__root__c                0    V ^8  d   QhR\         R\        /# )   dotted_pathreturnstrr   format   "6/usr/lib/python3.14/site-packages/pydantic/v1/utils.py__annotate__rE   z   s     g gs gs g    c                s   ^ RI Hp  V P                  R4      P                  R^4      w  r#T! T4      p \        YS4      #   \         d   p\        RT  R24      ThRp?ii ; i  \         d   p\        RT RT R	24      ThRp?ii ; i)
z
Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the
last name in the path. Raise ImportError if the import fails.
)import_module Z.Z"z!" doesn't look like a module pathNzModule "z" does not define a "z" attribute)Z	importlibrG   ZstripZrsplit
ValueErrorZImportErrorgetattrAttributeError)r=   rG   Zmodule_path
class_nameeZmodules   &     rD   import_stringrN   z   s    
 (V"-"3"3C"8"?"?Q"G ;'Fgv**  VAk]*LMNTUUV  gH[M1FzlR]^_effgs,   #? 
A" A
AA"B-B  Bmax_lenc                sR    V ^8  d   QhR\         \        ,          R\        R\        /# )r<   vrO   r>   )r   r@   intrA   rC   rD   rE   rE      s%      c
  S rF   c               s   \         P                  ! R\        4       \        V \        4      '       d9   \        V 4      V^,
          8  d"   V RV^,
           R,           P                  4       #  V P                  4       p \        V 4      V8  d   V RV^,
           R,           p V #   \         d    T P                  P                  T 4      p  LMi ; i)zX
Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long
z:`truncate` is no-longer used by pydantic and is deprecatedNu   …)	warningsZwarnZDeprecationWarning
isinstancer@   len__repr__	TypeError	__class__)rP   rO   s   &$rD   truncaterX      s     MMNPbc!Sc!f!4/Wq["U*4466$JJL 1vm!u$H	  $KK  #$s   +B   &C	C	c                r;   r<   rP   r>   r   boolrA   rC   rD   rE   rE      s     N NS NT NrF   c           	      sV    \        V \        \        \        \        \
        \        34      # N)rS   listtupleset	frozensetr
   r   rP      &rD   sequence_likerc      s    a$sI}eLMMrF   c                s`    V ^8  d   QhR\         \        \        ,          ,          R\        RR/# )r<   bases
field_namer>   N)r   r   r   r@   rA   rC   rD   rE   rE      s*     	 	xS	2 	 	 	rF   c                s`    V  F'  p\        W!R4      '       g   K  \        RV RV R24      h	  R# )zR
Ensure that the field's name does not shadow an existing attribute of the model.
NzField name "zI" shadows a BaseModel attribute; use a different field name with "alias='z'".)rJ   	NameError)rd   re   base   && rD   validate_field_nameri      sA     4T**zl +<<F<tM  rF   c                    V ^8  d   QhR\         R\        \        \         ,          \        \        \         ,          R3,          R3,          R\        /# )r<   oclass_or_tuple.Nr>   r   r   r   r   r[   rA   rC   rD   rE   rE      sA      # uT#Yd3iQTn@UW[5[/\ ae rF   c                 s>     \        W4      #   \         d     R # i ; iF)rS   rV   )rk   rl      &&rD   lenient_isinstancerp      s$    !,, s   
 c                rj   )r<   clsrl   .Nr>   rm   rA   rC   rD   rE   rE      sA      C tCy%S	SVBWY]7]1^ cg rF   c                 s     \        V \        4      ;'       d    \        W4      #   \         d    \        T \        4      '       d    R # h i ; irn   )rS   type
issubclassrV   r"   )rq   rl   ro   rD   lenient_issubclassrt      sC    #t$HHC)HH c=))s   % % !A	Ac                s$    V ^8  d   QhR\         /# r<   r>   )r[   rA   rC   rD   rE   rE      s     	 	D 	rF   c                 sB     \        R4       R#   \         d     R# i ; i)zM
Check whether we're in an ipython environment, including jupyter notebooks.
Z__IPYTHON__TF)Zevalrf    rF   rD   
in_ipythonrw      s(    ]   s    c                r;   )r<   
identifierr>   r@   r[   rA   rC   rD   rE   rE      s     K KC KD KrF   c                sh    V P                  4       ;'       d    \        P                  ! V 4      '       * # )z
Checks that a string is a valid identifier and not a Python keyword.
:param identifier: The identifier to test.
:return: True if the identifier is valid.
)ZisidentifierkeywordZ	iskeyword)rx   rb   rD   is_valid_identifierr{      s)     ""$JJW->->z-J)JJrF   KeyTypec                s    V ^8  d   QhR\         \        \        3,          R\         \        \        3,          R\         \        \        3,          /# )r<   mappingupdating_mappingsr>   )r   r|   r   rA   rC   rD   rE   rE      s@      gsl+ gslAS X\]dfi]iXj rF   c                 s   V P                  4       pV Fn  pVP                  4        FW  w  rEWB9   dI   \        W$,          \        4      '       d-   \        V\        4      '       d   \	        W$,          V4      W$&   KS  WRV&   KY  	  Kp  	  V# r\   )copyitemsrS   dictdeep_update)r}   r~   Zupdated_mappingZupdating_mappingkrP   s   &*    rD   r   r      ss    llnO-$**,DA#
?3Et(L(LQ[\]_cQdQd%01CQ%G"%&"	 - . rF   c                sV    V ^8  d   QhR\         \        \        3,          R\        RR/# )r<   r}   updater>   N)r   r   rA   rC   rD   rE   rE      s.     G GT#s(^ Gs Gt GrF   c                 s    T P                  VP                  4        UUu/ uF  w  r#Vf   K  W#bK  	  upp4       R # u uppi r\   )r   r   )r}   r   r   rP   s   &,  rD   update_not_noner      s.    NNV\\^E^TQqDAD^EFEs   <
<
deltag:0yE>c                sH    V ^8  d   QhR\         R\         R\         R\        /# )r<   value_1value_2r   r>   )floatr[   rA   rC   rD   rE   rE      s)     + + + +% +SW +rF   c               s*    \        W,
          4      V8*  # )z,
Return True if two floats are almost equal
)Zabs)r   r   r   s   &&$rD   almost_equal_floatsr      s     w !U**rF   c                sv    V ^8  d   QhR\         R,          R\        \        R3,          R\        R,          RR/# )	r<   initfieldsr.   configr,   r>   r*   ).N)r   r   r@   r   rA   rC   rD   rE   rE      sF     >V >V
9
>V'+C,='>>VHL\HZ>V>VrF   c                s   ^ RI HpHpHp ^ RIHp V! V 4      P                  P                  4       p/ pRp	Rp
\        V^R4       F/  pVP                  VP                  J d   Tp	K!  WVP                  &   K1  	  V	'       d   VP                  pVP                  4        F  w  rVP                  pW9   g   W9   d   K  \        V4      '       g!   V'       d   \        V4      '       d   TpMRp
KP  VP                   '       g   RVP"                  /M/ pV! WP$                  3RVP&                  /VB W&   K  	  VP(                  VP*                  J d   Rp
V	'       d   V
'       d   RVP,                  3R	VP                  3.pV Uu. uF  pVP                  VP                  3NK  	  upV8X  d   R
pMV	P                  pVV9   d   VR,          pK  V	P/                  VR7      VV&   V! \1        VP                  4       4      RR7      # u upi )z2
Generate signature for model based on its fields
)	Parameterr*   	signature)ExtraNFTdefault
annotationZ__pydantic_self__ZdataZ
extra_data_name)
parametersZreturn_annotation)inspectr   r*   r   pydantic.v1.configr   r   valuesr   ZkindZVAR_KEYWORDr   Zallow_population_by_field_namer   aliasr{   Zrequiredr   ZKEYWORD_ONLYr   ZextraZallowZPOSITIONAL_OR_KEYWORDZreplacer]   )r   r   r   r   r*   r   r   Zpresent_paramsZmerged_paramsZvar_kwZ
use_var_kwZparamZallow_namesre   ZfieldZ
param_namekwargsZdefault_model_signaturepZvar_kw_names   &&&                 rD   generate_model_signaturer      s    87(t_//668N*,MFJ40::***F$)ejj!	 1 ;;!'JJ*j.I(44#6z#B#B!+J!%J 8=~~~i/2F(122)?D?O?O)SY)M% "0" ||u{{"
* !)"A"ABY**+#
 '55nQVVQVVn59PP&K !++K V#3K%+^^^%Ek"]%9%9%; <PTUU 6s   >!G>c                s|    V ^8  d   QhR\         \        R,          \        R,          3,          R\        R,          /# )r<   objr0   r-   r>   )r   r   rA   rC   rD   rE   rE   -  s3     
 
5k*D,==> 
4CT 
rF   c                 s    ^ RI Hp  V P                  p\	        W!4      '       g   \        R4      hV#   \         d    T p L-i ; i)r    r/   z7Unsupported type, must be either BaseModel or dataclass)pydantic.v1.mainr0   __pydantic_model__rK   rs   rV   )r   r0   Z	model_cls   &  rD   	get_modelr   -  sJ    ***	 i++QRR  	s   2 AAc                0    V ^8  d   QhR\         R\         /# r<   stringr>   r@   rA   rC   rD   rE   rE   :  s     D DS DS DrF   c                 sP    R P                  R V P                  R4       4       4      # )Z c              3   s@   "   T F  qP                  4       x  K  	  R # 5ir\   )Z
capitalize).0Zword   & rD   	<genexpr>Zto_camel.<locals>.<genexpr>;  s     C1B??$$1Bs   r   )joinZsplit)r   rb   rD   to_camelr   :  s     77Cc1BCCCrF   c                r   r   r   rA   rC   rD   rE   rE   >  s      3 3 rF   c                 s    \        V 4      ^8  d1   \        V 4      pV^ ,          P                  4       VR,          ,           # V P                  4       # )   :r   NN)rT   r   Zlower)r   Zpascal_stringr   rD   to_lower_camelr   >  sB    
6{a (Q%%'-*;;;<<>rF   Tname_factoryc                s    V ^8  d   QhR\         \        \        ,          \        \        R3,          3,          R\        \        .\
        3,          R\        \        ,          /# )r<   
input_list.r   r>   )r   r   r   r   r   r@   rA   rC   rD   rE   rE   H  sM      d1guQV},- A38$ 
!W	rF   c               s    . p. pV  FH  pV! V4      pWS9  d%   VP                  V4       VP                  V4       K5  WBVP                  V4      &   KJ  	  V# )z
Make a list unique while maintaining order.
We update the list if another one with the same name is set
(e.g. root validator overridden in subclass)
)ZappendZindex)r   r   ZresultZresult_namesrP   Zv_names   &$    rD   unique_listr   H  s[     F La%'MM!12<%%f-.  MrF   c                   s6   a  ] tR tRt o RtV 3R lR ltRtV tR# )r6   i_  z
String class where repr doesn't include quotes. Useful with Representation when you want to return a string
representation of something that valid (or pseudo-valid) python.
c                    < V ^8  d   QhRS[ /# ru   r   rB   __classdict__   "rD   rE   ZPyObjectStr.__annotate__e  s      # rF   c                    \        V 4      # r\   r   selfrb   rD   rU   ZPyObjectStr.__repr__e  s    4yrF   rv   N)__name__
__module____qualname____firstlineno____doc__rU   __static_attributes____classdictcell__r      @rD   r6   r6   _  s     
 rF   c                   s   a  ] tR tRt o Rt]! 4       tV 3R lR ltV 3R lR ltV 3R lR lt	V 3R	 lR
 lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R ltRtV tR# )r7   ii  z
Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.

__pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations
of objects.
c                   < V ^8  d   QhRR/# r<   r>   r5   rv   r   r   rD   rE   Representation.__annotate__s  s     	; 	;z 	;rF   c                sv   a  V 3R lS P                    4       pV UUu. uF  w  r#Vf   K  W#3NK  	  upp# u uppi )a  
Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden.

Can either return:
* name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]`
* or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]`
c              3   s>   <"   T F  q\        SV4      3x  K  	  R # 5ir\   )rJ   )r   Zsr   s   & rD   r   Z/Representation.__repr_args__.<locals>.<genexpr>{  s     ?1WT1%&s   )	__slots__)r   ZattrsarP   s   f   rD   __repr_args__ZRepresentation.__repr_args__s  s4     @?#(:541A5:::s   55c                r   ru   r   r   r   rD   rE   r   ~  s     ' 's 'rF   c                s.    V P                   P                  # )z1
Name of the instance's class, used in __repr__.
)rW   r   r   rb   rD   __repr_name__ZRepresentation.__repr_name__~  s     ~~&&&rF   c                &   < V ^8  d   QhRS[ RS[ /# )r<   join_strr>   r   r   r   rD   rE   r     s     f fS fS frF   c                sN    VP                  R  V P                  4        4       4      # )c              3   sT   "   T F  w  rVf   \        V4      MV RV: 2x  K   	  R # 5i)N=)Zrepr)r   r   rP   r   rD   r   Z.Representation.__repr_str__.<locals>.<genexpr>  s+     ePd	T!W!AaU|CPds   &()r   r   )r   r   ro   rD   __repr_str__ZRepresentation.__repr_str__  s!    }}ePTPbPbPdeeerF   c          	      sZ   < V ^8  d   QhRS[ S[.S[3,          RS[RS[S[RR3,          /# )r<   fmtr   r>   N)r   r   r   r   r   rD   rE   r     s<      hucz2 c iPSUY[_P_F` rF   c              +  s   "   V P                  4       R,           x  ^x  V P                  4        F&  w  r4Ve   VR,           x  V! V4      x  Rx  ^ x  K(  	  Rx  Rx  R# 5i)zr
Used by devtools (https://python-devtools.helpmanual.io/) to provide a human readable representations of objects
(Nr   Z,)i)r   r   )r   r   r   r   values   &&,  rD   
__pretty__ZRepresentation.__pretty__  se        "S((--/KDSj e*IG 0 	s   A"A$c                r   ru   r   r   r   rD   rE   r     s     & & &rF   c                s$    V P                  R 4      # )rH   )r   r   rb   rD   __str__ZRepresentation.__str__  s      %%rF   c                r   ru   r   r   r   rD   rE   r     s     D D# DrF   c                sL    V P                  4        R V P                  R4       R2# )r   , r   )r   r   r   rb   rD   rU   ZRepresentation.__repr__  s+    $$&'q):):4)@(ACCrF   c                r   )r<   r>   RichReprResultrv   r   r   rD   rE   r     s     ' '/ 'rF   c              #  s^   "   V P                  4        F  w  rVf   Vx  K  W3x  K  	  R# 5i)zGet fields for Rich libraryN)r   )r   r   Z
field_reprr   rD   __rich_repr__ZRepresentation.__rich_repr__  s/      $ 2 2 4D|  &&	 !5s   +-c                s:   < V ^8  d   Qh/ S[ S[R3,          ;R&   # )r<   .r   )r   r@   r   r   rD   rE   r   i  s      S#X( rF   rv   N)r   r   r   r   r   r^   r   r   r   r   r   r   rU   r   Z__annotate_func__r   r   r   r   rD   r7   r7   i  se      "'I	; 	;' 'f f & &D D' 'g  rF   c                   s  a  ] tR tRt o RtRtV 3R lR ltV 3R lR ltRV 3R lR	 lltV 3R
 lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# ) r8   i  z
Hack to make object's smell just enough like dicts for validate_model.

We can't inherit from Mapping[str, Any] because it upsets cython so we have to implement all methods ourselves.
c                r   )r<   r   r   r   r   rD   rE   GetterDict.__annotate__  s      C rF   c                s    Wn         R # r\   _obj)r   r   ro   rD   __init__ZGetterDict.__init__  s    	rF   c                &   < V ^8  d   QhRS[ RS[/# )r<   keyr>   r?   r   r   rD   rE   r     s     ' 's 's 'rF   c                sn     \        V P                  V4      #   \         d   p\        T4      ThR p?ii ; ir\   )rJ   r   rK   KeyError)r   r   rM   rh   rD   __getitem__ZGetterDict.__getitem__  s4    	'499c** 	'3-Q&	's    4/4Nc                s,   < V ^8  d   QhRS[ RS[ RS[ /# )r<   r   r   r>   r   r   r   rD   rE   r     s"     0 0s 0S 0C 0rF   c                s.    \        V P                  W4      # r\   )rJ   r   )r   r   r      &&&rD   getZGetterDict.get  s    tyy#//rF   c                0   < V ^8  d   QhRS[ S[,          /# ru   )r   r   r   r   rD   rE   r     s      CH rF   c                s    \        4       # )z^
We don't want to get any other attributes of obj if the model didn't explicitly ask for them
)r_   r   rb   rD   
extra_keysZGetterDict.extra_keys  s     urF   c                r   ru   r   r   r   r   rD   rE   r     s      d3i rF   c                r   )zu
Keys of the pseudo dictionary, uses a list not set so order information can be maintained like python
dictionaries.
)r]   r   rb   rD   keysZGetterDict.keys  s    
 DzrF   c                r   ru   r   r   r   rD   rE   r     s     ' 'S	 'rF   c                s<    V  Uu. uF  qV,          NK  	  up# u upi r\   rv   r   r   r   rD   r   ZGetterDict.values  s    !%&AQ&&&s   c                sF   < V ^8  d   QhRS[ S[S[S[3,          ,          /# ru   )r   r   r@   r   r   r   rD   rE   r     s!     ! !xc3h0 !rF   c              #  sH   "   V  F  pWP                  V4      3x  K  	  R # 5ir\   )r   r   r   rD   r   ZGetterDict.items  s     AXXa[.  s    "c                r   ru   )r   r@   r   r   rD   rE   r     s      (3- rF   c              #  s   "   \        V P                  4       F   pVP                  R 4      '       d   K  Vx  K"  	  R# 5i)r   N)Zdirr   
startswith)r   r   r   rD   __iter__ZGetterDict.__iter__  s+     		ND??3''
 #s   ->
>c                r   ru   rQ   r   r   rD   rE   r     s     $ $ $rF   c                s&    \        R  V  4       4      # )c              3   s&   "   T F  p^x  K	  	  R# 5i)r   Nrv   )r   r   r   rD   r   Z%GetterDict.__len__.<locals>.<genexpr>  s     #d1ds   )Zsumr   rb   rD   __len__ZGetterDict.__len__  s    #d###rF   c                r   r<   itemr>   rZ   r   r   rD   rE   r     s     # # # #rF   c                s&    WP                  4       9   # r\   )r   r   r   ro   rD   __contains__ZGetterDict.__contains__  s    yy{""rF   c                r   )r<   otherr>   rZ   r   r   rD   rE   r     s     1 1C 1D 1rF   c                sL    \        V 4      \        VP                  4       4      8H  # r\   )r   r   )r   r   ro   rD   __eq__ZGetterDict.__eq__  s    DzT%++-000rF   c                r   r   rv   r   r   rD   rE   r     s     $ $z $rF   c                s    R \        V 4      3.# r\   )r   r   rb   rD   r   ZGetterDict.__repr_args__  s    tDz"##rF   c                r   ru   r   r   r   rD   rE   r     s     ; ;s ;rF   c                s4    R \        V P                  4       R2# )zGetterDict[Z])r$   r   r   rb   rD   r   ZGetterDict.__repr_name__  s    _TYY78::rF   r   r\   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rD   r8   r8     s      I ' '0 0  ' '! ! 
$ $# #1 1$ $; ;rF   c                   s  a  ] tR tRt o RtRtV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 lt	V 3R lR lt
]RV 3R lR ll4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltRtV tR# )r9   i  zQ
Class for more convenient calculation of excluded or included fields on values.
c                s8   < V ^8  d   QhRS[ RS[R,          RR/# )r<   r   r   r>   Nr1   r4   )r   r   r   r   rD   rE   ValueItems.__annotate__  s)     0 0c 0%0W*X 0]a 0rF   c                s    V P                  V4      p\        V\        \        34      '       d   V P	                  V\        V4      4      pW n        R # r\   )_coerce_itemsrS   r]   r^   _normalize_indexesrT   _items)r   r   r   r   rD   r   ZValueItems.__init__  s>    ""5)edE]++++E3u:>E*/rF   c                r   r   rZ   r   r   rD   rE   r     s     3 3 3 3rF   c                sV    V P                  V P                  P                  V4      4      # )zH
Check if item is fully excluded.

:param item: key or index of a value
)is_truer   r   r   ro   rD   is_excludedZValueItems.is_excluded  s      ||DKKOOD122rF   c                r   r   rZ   r   r   rD   rE   r     s     # # # #rF   c                s    WP                   9   # )zP
Check if value is contained in self._items

:param item: key or index of value
r   r   ro   rD   is_includedZValueItems.is_included  s     {{""rF   c                sB   < V ^8  d   QhRRRS[ S[R,          ,          /# )r<   rM   r3   r>   r   )r   r   r   r   rD   rE   r     s&     8 8X 8(59`3a*b 8rF   c                sn    V P                   P                  V4      pV P                  V4      '       g   V# R# )z~
:param e: key or index of element on value
:return: raw values for element if self._items is dict and contain needed element
N)r   r   r   )r   rM   r   rh   rD   for_elementZValueItems.for_element  s/     {{q!<<--t747rF   c                s(   < V ^8  d   QhRRRS[ RR/# )r<   r   r4   v_lengthr>   r2   r   r   r   rD   rE   r     s#     %  % (: % c % o % rF   c                s   / pRpVP                  4        F  w  rV\        V\        4      '       gI   \        V\        4      '       g3   V P	                  V4      '       g   \        RV RVP                   24      hVR8X  d   V P                  V4      pK}  \        V\        4      '       g   \        R4      hV^ 8  d	   W%,           MTpV P                  WcP                  V4      4      W7&   K  	  V'       g   V# V P	                  V4      '       d'   \        V4       F  pVP                  VR4       K  	  V# \        V4       FA  pVP                  V/ 4      pV P	                  V4      '       d   K.  V P                  WH4      W5&   KC  	  V# )a.  
:param items: dict or set of indexes which will be normalized
:param v_length: length of sequence indexes of which will be

>>> self._normalize_indexes({0: True, -2: True, -1: True}, 4)
{0: True, 2: True, 3: True}
>>> self._normalize_indexes({'__all__': True}, 4)
{0: True, 1: True, 2: True, 3: True}
Nz,Unexpected type of exclude value for index "z" __all__zExcluding fields from a sequence of sub-models or dicts must be performed index-wise: expected integer keys or keyword "__all__".)r   rS   r   r   r   rV   rW   _coerce_valuerQ   merger   ZrangeZ
setdefault)	r   r   r   Znormalized_itemsZ	all_itemsZirP   Znormalized_iZnormalized_items	   &&&      rD   r   ZValueItems._normalize_indexes  sY    -/	KKMDAq'**jK.H.HDLLYZOO"NqcQSTUT_T_S` abbI~ ..q1	a%%A  ,-q58<aL-1ZZ;O;OP\;]-^* " ##<<	""8_ ++As3 %##xA.99!R@O<<00&*jj&L # !  rF   c                s2   < V ^8  d   QhRS[ RS[ RS[RS[ /# )r<   rg   override	intersectr>   rZ   r   r   rD   rE   r   3  s)     $ $ $ $ $ $rF   c                sZ   V P                  V4      pV P                  V4      pVf   V# V P                  V4      '       g   Vf   V# V P                  V4      '       d   V'       d   V# T# V'       d;   V Uu. uF  qDV9   g   K  VNK  	  upV Uu. uF  qDV9   g   K  VNK  	  up,           pM*\        V4      V Uu. uF  qDV9  g   K  VNK  	  up,           p/ pV F?  pV P                  VP	                  V4      VP	                  V4      VR7      pVf   K;  WvV&   KA  	  V# u upi u upi u upi )a  
Merge a ``base`` item with an ``override`` item.

Both ``base`` and ``override`` are converted to dictionaries if possible.
Sets are converted to dictionaries with the sets entries as keys and
Ellipsis as values.

Each key-value pair existing in ``base`` is merged with ``override``,
while the rest of the key-value pairs are updated recursively with this function.

Merging takes place based on the "union" of keys if ``intersect`` is
set to ``False`` (default) and on the intersection of keys if
``intersect`` is set to ``True``.
)r   )r   r   r]   r   r   )rq   rg   r   r   r   Z
merge_keysZmergedZmerged_items   &&&&    rD   r   ZValueItems.merge2  s     $$X.  &K;;tO;;x  $42(2 %);T(]!!T;(>`(Q[_V_qq(>``Jd(&L(Qtmqq(&LLJ"$A))DHHQKaI)VK&'q	 
  <>`&Ls$   5DDD#D#9D(D(c                s2   < V ^8  d   QhRS[ R,          RR/# )r<   r   r4   r>   r   )r   r   r   rD   rE   r   Z  s"      U#JK Pb rF   c                s    \        V \        4      '       d    V # \        V \        4      '       d   \        P	                  V R 4      p V # \        V RR4      p\        V RV 24       V # ).rW   z???z!Unexpected type of exclude value )rS   r   r   r   ZfromkeysrJ   assert_never)r   rL   r   rD   r   ZValueItems._coerce_itemsY  sk    eW%%  {++MM%-E  !U;J3J<@ rF   c                r   )r<   r   r>   r   r   r   rD   rE   r   h  s     ( (# (# (rF   c                s^    Ve   V P                  V4      '       d   V# V P                  V4      # r\   )r   r   )rq   r   ro   rD   r   ZValueItems._coerce_valueg  s+    =CKK..L  ''rF   c                r   rY   rZ   r   r   rD   rE   r   n  s     % %3 %4 %rF   c                s"    V R J ;'       g    V RJ # )T.rv   ra   rb   rD   r   ZValueItems.is_truem  s    Dy$$AH$rF   c                r   r   rv   r   r   rD   rE   r   q  s     % %z %rF   c                s     R V P                   3.# r\   r   r   rb   rD   r   ZValueItems.__repr_args__q  s    t{{#$$rF   r   N)r   Z_typern   )r   r   r   r   r   r   r   r   r   r   r   Zclassmethodr   Zstaticmethodr   r   r   r   r   r   r   r   rD   r9   r9     s      $I0 03 3# #8 8%  % N $ $ $L   ( (
 % %% %rF   c                   sL   a  ] tR tRt o RtRtV 3R lR ltV 3R lR ltRtV t	R# )	r:   iu  z)
Hide class attribute from its instances
c                s*   < V ^8  d   QhRS[ RS[RR/# )r<   r   r   r>   Nr?   r   r   rD   rE   ClassAttribute.__annotate__  s"      S   rF   c                s    Wn         W n        R # r\   r   r   )r   r   r   r   rD   r   ZClassAttribute.__init__  s    	
rF   c                s:   < V ^8  d   QhRS[ RS[S[ ,          RR/# )r<   instanceownerr>   N)r   r   r   r   rD   rE   r    s+     ] ] ]DI ]$ ]rF   c                sp    Vf   V P                   # \        V P                  : RVP                  : R24      h)Nz attribute of z is class-only)r   rK   r   r   )r   r  r  r   rD   __get__ZClassAttribute.__get__  s3    ::		}N5>>:LN[\\rF   r  N)
r   r   r   r   r   r   r   r  r   r   r   r   rD   r:   r:   u  s'     I
 ] ]rF   Zis_dirZ	directoryZis_fileZfileZis_mountzmount pointZ
is_symlinkZsymlinkZis_block_devicezblock deviceZis_char_devicezchar deviceZis_fifoZFIFOZ	is_socketZsocketc                s(    V ^8  d   QhRRR\         /# )r<   r   r+   r>   r   rA   rC   rD   rE   rE     s     	 	 	C 	rF   c                s    V P                  4       '       g   Q R4       h\        P                  4        F  w  r\        W4      ! 4       '       g   K  Vu # 	  R# )z(
Find out what sort of thing a path is.
zpath does not existZunknown)Zexists
path_typesr   rJ   )r   Zmethodr   r   rD   	path_typer    sG     88::,,,:"((*1K + rF   Objc                r   )r<   r   r>   )r  rA   rC   rD   rE   rE     s        rF   c                s    V P                   pV\        9   d   V #  V '       g(   V\        9   d   V\        J d   V # V P	                  4       # \        T 4      #   \
        \        \        3 d     L#i ; i)z
Return type as is for immutable built-in types
Use obj.copy() for built-in empty collections
Use copy.deepcopy() for non-empty collections and unknown objects
)	rW   IMMUTABLE_NON_COLLECTIONS_TYPESBUILTIN_COLLECTIONSr^   r   rV   rI   ZRuntimeErrorr   )r   Zobj_typer   rD   smart_deepcopyr    sj     }}H22
x#66"e+3;;
 C=	 z<0 s   A A A A.-A.c                r;   r<   r   r>   ry   rA   rC   rD   rE   rE     s        rF   c                 sF    V P                  R 4      '       g   R# \        V 8H  # )r   T)r   ROOT_KEYr   rb   rD   is_valid_fieldr    s    ??3trF   c                r;   r  ry   rA   rC   rD   rE   rE     s     F F F FrF   c                 sD    \        V 4      '       * ;'       d
    V \        9  # r\   )r  DUNDER_ATTRIBUTESr   rb   rD   is_valid_private_namer    s    d##EE4E(EErF   c                sh    V ^8  d   QhR\         \        ,          R\         \        ,          R\        /# )r<   leftrightr>   )r   r   r[   rA   rC   rD   rE   rE     s)       hsm  rF   c                sJ    \        W\        R7       F  w  r#W#Jg   K   R# 	  R# )z
Check that the items of `left` are the same objects as those in `right`.

>>> a, b = object(), object()
>>> all_identical([a, b, a], [a, b, a])
True
>>> all_identical([a, b, [a]], [a, b, [a]])  # new list object, while "equal" is not "identical"
False
)Z	fillvalueFT)r   _EMPTY)r  r  Z	left_itemZ
right_items   &&  rD   all_identicalr    s'     "-TF!K	& "L rF   c                s<    V ^8  d   QhR\         R\        R\         /# )r<   r   msgr>   )r   r@   rA   rC   rD   rE   rE     s!      h S X rF   c                s    \        V4      h)z
Helper to make sure that we have covered all possible types.

This is mostly useful for ``mypy``, docs:
https://mypy.readthedocs.io/en/latest/literal_types.html#exhaustive-checks
)rV   )r   r  ro   rD   r   r     s     C.rF   c                sR    V ^8  d   QhR\         \        ,          R\        R\        /# )r<   all_aliasesdiscriminator_keyr>   )r   r@   rA   rC   rD   rE   rE     s'        
3  TW  \_  rF   c           
     s    \        V 4      p\        V4      ^8  d,   \        RV: RRP                  \	        V 4      4       R24      hVP                  4       # )zNValidate that all aliases are the same and if that's the case return the aliaszAliases for discriminator z must be the same (got r   r   )r_   rT   r    r   ZsortedZpop)r  r  Zunique_aliasesrh   rD   get_unique_discriminator_aliasr    sa    %N
>Q():(==TUYU^U^_efq_rUsTttuv
 	
 rF   c          
      sx    V ^8  d   QhR\         R\        R\        \        \        \        R3,          3,          /# )r<   tpr  r>   .)r   r@   r   rA   rC   rD   rE   rE     s>     &` &`3 &`3 &`5QTV[\_ad\dVeQeKf &`rF   c                s   \        V RR4      p\        V 4      \        J d   \        V 4      ^ ,          p \	        V R4      '       d   V P
                  p \        \        V 4      4      '       d=   \        W4      w  r4T\        ;QJ d    . R V 4       F  NK  	  53# ! R V 4       4      3# V'       dn   V P                  \        ,          P                  p\        WQ4      w  r4\        \        V4      4      ^8  d   \        RV: R\        V 4      : 24      hW4^ ,          3#  V P                  V,          P                  p\)        T4      '       g   \        RT: RT P$                  : R24      hT P                  T,          P*                  \-        T4      3#   \          d!   p\#        RT P$                  : R24      ThR	p?i\&         d$   p\        R
T P$                  : RT: 24      ThR	p?ii ; i)z
Get alias and all valid values in the `Literal` type of the discriminator field
`tp` can be a `BaseModel` class or directly an `Annotated` `Union` of many.
Z__custom_root_type__Fr   c              3   s4   "   T F  q F  q"x  K  	  K  	  R # 5ir\   rv   )r   r   rP   r   rD   r   Z5get_discriminator_alias_and_values.<locals>.<genexpr>  s     GJ&1AAJs   zField z& is not the same for all submodels of zType z* is not a valid `BaseModel` or `dataclass`NzModel z% needs a discriminator field for key z
 of model z needs to be a `Literal`)rJ   r&   r   r%   Zhasattrr   r(   _get_union_alias_and_all_valuesr^   Z
__fields__r  Ztype_rT   r_   r    r$   rK   rV   r   r   r'   r   r#   )r  r  Zis_root_modelr   
all_values
union_typeZt_discriminator_typerM   s   &&      rD   "get_discriminator_alias_and_valuesr    s   
 B 6>M"~"b\!_r'((""
2;BReeGJGeGGeGJGGGG	]]8,22
;JZs:!#*--STcdfTgSjk  m##	y#%==1B#C#I#I  344'8&;:bkk_Tlmnn}}./557IJ^7___  	feBKK?2\]^dee 	yr{{o5Z[lZopqwxx	ys*   F G(F77G(G(G##G(c                s    V ^8  d   QhR\         \        ,          R\        R\        \        \        \        \        R3,          R3,          3,          /# )r<   r  r  r>   .)r   r   r@   r   rA   rC   rD   rE   rE      sI     V VS	V.1V
3eCHos*++,VrF   c                 s    \        V 4       Uu. uF  p\        W!4      NK  	  pp\        V!  w  rE\        WA4      V3# u upi r\   )r%   r  Zzipr  )r  r  ZtZzipped_aliases_valuesr  r  s   &&    rD   r  r     sN     `hhr_st_sZ[?U_st!#89K)+I:UU us   <c                s    V ^8  d   Qh/ ^ \         9   d    \        \        \        ,          ,          ;R&   ^\         9   d    \        \        \        ,          ,          ;R&   # )r<   r	  r
  )__conditional_annotations__r   r   r   rA   rC   rD   rE   rE      sF    l T#Y m Z	 	Sc^ 	[ rF   )rN   rc   ri   rp   rt   rw   r{   r   r   r   r   r   r   r  r  r6   r7   r8   r9   r)   r:   r  r  r  r  r  >	   r   r   r   Z__classcell__Z__orig_bases__Z__orig_class__Z__annotations__r   r   )r  rz   rR   ZweakrefZcollectionsr   r   r   r   r   Z	itertoolsr   r   Ztypesr   r   r	   r
   r   r   Ztypingr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Ztyping_extensionsr   Zpydantic.v1.errorsr    Zpydantic.v1.typingr!   r"   r#   r$   r%   r&   r'   r(   Zpydantic.v1.versionr)   r   r*   Zpathlibr+   r   r,   Zpydantic.v1.dataclassesr-   Zpydantic.v1.fieldsr.   r   r0   r1   r2   r3   r4   r5   r@   r   r   r  rQ   r   Zcomplexr[   Zbytesrr   ZrefZNotImplementedrW   ZEllipsisr	  r]   r_   r^   r`   r   r
  rN   rX   rc   ri   rp   rt   rw   r{   r|   r   r   r   r   r   r   r   r   r   r6   r7   r8   r9   r:   r  r  r  r  r  r  r  Zobjectr  r  r   r  r  r  rE   )r  r   rD   <module>r     sm      7 7  ) d d    * ( *	 	 	 -!-1-*ggeCsU38_eCQTVYMFZ$Z[\N:  		KK '3  0 				'  	g&b "N		K )
G+$ +>VB
D CL (+.# 9' 9'x;; ;;|O% O%d] ]* kv)~mv	
	 en*
 F 
  &`RVrF   