
    i9                       % S SK Jr  S SKrS SKJrJrJr  S SKJrJ	r	J
r
JrJr  S SKJrJrJrJrJr  S SKJr  SSKJrJrJrJrJrJrJrJrJr  SS	KJ r   SS
K!J"r"  SSK#J$r$J%r%J&r&J'r'J(r(J)r)  SSK*J+r+  SSK,J-r-  SSK.J/r/J0r0J1r1  SSKJ2r2  SSK3J4r4  SSK5J6r6J7r7  \(       a  SSK8J9r9  / SQr:     S)           S*S jjr;\" S5      r<0 SSSS4                   S+S jjr=    S,               S-S jjr>0 SSSSSS4                       S.S jjr?      S/                   S0S jjr@\\\	   /\	4   rA\\B\	S4   /\	4   rCS\DS '     S1         S2S! jjrE\\\	\	4   /\	4   rF  S1         S3S" jjrG\GrHS#\DS$'   \I\\S4         S4S% jjrJ\JrKS#\DS&'    S5       S6S' jjrL\LrMS#\DS('   g)7    )annotationsN)CallableIterableMapping)TYPE_CHECKINGAnyFinalLiteralTypeVar)NOTHING	Attribute	ConverterFactoryevolve)	NoDefault   )	ANIES	TypeAliasadapted_fieldsget_args
get_originis_annotatedis_bareis_bare_final
is_generic)deep_copy_with)UnstructureHook)AttributeValidationNoteClassValidationErrorForbiddenExtraKeysErrorIterableValidationErrorIterableValidationNoteStructureHandlerNotFoundError)identity)SimpleStructureHook   )AttributeOverridealready_generatingneutral)generate_mapping)generate_unique_filename)_annotated_override_or_defaultfind_structure_handler)BaseConverter)make_dict_structure_fn!make_dict_structure_fn_from_attrsmake_dict_unstructure_fn#make_dict_unstructure_fn_from_attrs make_hetero_tuple_unstructure_fnmake_iterable_unstructure_fnmake_mapping_structure_fnmake_mapping_unstructure_fnc                    [        XX#U5      $ )zOverride how a particular field is handled.

:param omit: Whether to skip the field or not. `None` means apply default handling.
)r'   )omit_if_defaultrenameomitstruct_hookunstruct_hooks        R/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/cattrs/gen/__init__.pyoverrider>   5   s     _dWW    TFTfrom_converterc                \	   SUR                   -   n	0 n
/ n/ n0 nUS:X  a  [        USS5      nU  GH  nUR                  nX;   a  X   nO([        UR                  [
        5      nU[
        :w  a  UX'   UR                  (       a  MU  UR                  c  UR                  (       d	  U(       d  M|  UR                  c(  U(       d  UOUR                  nUU:w  a  [        UUS9X'   OUR                  nUR                  nSnUR                  b  UR                  nGOUR                  b  UR                  n[        U[        5      (       a-  UR                   U;   a  UUR                      nOIUR                  nO<[!        U5      (       a,  [#        U5      (       d  [%        U5      (       d  ['        UX15      nUcj  [)        U5      (       aH  UR                  [*        La5  [        UR                  [,        5      (       d  UR                  R.                  n UR1                  USS9nOOUR                  nU[4        :H  nU(       d  SU 3nUU
U'   UUU'   U S	U S
3nOSU 3nU[*        LGaD  U(       a  UR6                  SLd  UR6                  (       Ga  SU 3n[        U[,        5      (       a:  UR8                  U
U'   UR8                  UU'   UR:                  (       a  U S3OU S3nOUU
U'   UUU'   UnUR<                  nUb{  SU 3n[        U[>        5      (       a#  UU
U'   UUU'   SU 3nXU'   XU'   U SU SU S
3nO>[        U[,        5      (       a  UU
U'   UUU'   U SU S
3nOU" U5      U
U'   U" U5      UU'   URA                  SU SU S35        URA                  SU SU 35        GMr  URA                  SU SU S35        GM     SRC                  U Vs/ s H
  nU SU 3PM     sn5      nU(       a  SU 3nURE                  5        H  u  nn U U
U'   M     SU	 SU S3/S /-   U V!s/ s H  n!S!U! 3PM
     sn!-   S"/-   U-   S#/-   n"S$RC                  U"5      n#[G        US%U(       a  U"O/ S&9n$[I        [K        U#U$S'5      U
5        X   n%UU%l&        U%$ ! [2         a    UR                  n GN|f = fs  snf s  sn!f )(a  
Generate a specialized dict unstructuring function for a list of attributes.

Usually used as a building block by more specialized hook factories.

Any provided overrides are attached to the generated function under the
`overrides` attribute.

:param cl: The class for which the function is generated; used mostly for its name,
    module name and qualname.
:param _cattrs_omit_if_default: if true, attributes equal to their default values
    will be omitted in the result dictionary.
:param _cattrs_use_alias: If true, the attribute alias will be used as the
    dictionary key by default.
:param _cattrs_include_init_false: If true, _attrs_ fields marked as `init=False`
    will be included.

.. versionadded:: 24.1.0
.. versionchanged:: 25.2.0
    The `_cattrs_use_alias` parameter takes its value from the given converter
    by default.
.. versionchanged:: 26.1.0
    `typing.Annotated[T, override()]` is now recognized and can be used to customize
    unstructuring.
.. versionchanged:: 26.1.0
    When `_cattrs_omit_if_default` is true and the attribute has an attrs converter
    specified, the converter is applied to the default value before checking if it
    is equal to the attribute's value.
unstructure_rA   	use_aliasFNr9   cache_result
__c_unstr_z
(instance.)	instance.__c_def_z
(instance)z()	__c_conv_
__c_field_(z, instance, z  if instance.z != :	    res[''] = 'z': ,, =def z	(instance):	  res = {    z  }  return res
unstructurelinesexec)'__name__getattrnamer,   typer)   r:   initr9   aliasr   defaultr<   
isinstancer   r\   r   r   r   r   r   r   r   	__class__get_unstructure_hookRecursionErrorr$   r8   factory
takes_self	converterr   appendjoinitemsr+   evalcompile	overrides)&attrsclrm   typevar_map_cattrs_omit_if_default_cattrs_use_linecache_cattrs_use_alias_cattrs_include_init_falsekwargsfn_nameglobsr^   invocation_linesinternal_arg_partsa	attr_namer>   kndhandlertis_identityunstruct_handler_nameinvokedef_namedef_strc	conv_name
field_nameiinternal_arg_linekvlinetotal_linesscriptfnameress&                                         r=   r2   r2   F   s   R r{{*GEE,,#I{EBFF	(H5affgFH7"$,!==== 8R??""3BY$*8B$?!BII
 !!-,,Gvv!FFa))zz[0'

3"+"7"7]]71::l1oo&q+:A?%a((IIW4 *199g > > II//8"+"@"@QV"@"W # $//)&0$<!+2E'(8?45-.j1EF ,FG$)A)A)N'''!)-H!W%%"#))h/0yy"8,56\\XJj1(SU"#h/0"8,"A}'	{3	a++'(E)$45&y1#-i[!9J()*%56z2!*1WI\*QOG7++'(E)$45&y1!*1WIQ7G&'dE(O34Q4&x0LL>)D	CDLL9RDfX67 ##at3vha$89O R 		7I"J7I!aS!:7I"JK !2 34"((*1a + y	"3!4B	78-	%5
6%5TT$=%5
6	7 '	 		
 
	  YY{#F$
M0E2E 		'/
.CCMJa * 8"+"7"78p #K 7s   RR$R)R! R!c                   [        U 5      n[        U=(       d    U 5      n0 n	US:X  a  [        USS5      n[        U 5      (       a  [	        X	5      n	Ub  Un  [
        R                  n
X
;   a
  [        5       eU
R                  U 5         [        UU UU	4UUUUS.UD6U
R                  U 5        U
(       d  [
        ?$ $ ! [         a    [        5       n
U
[
        l         Nuf = f! U
R                  U 5        U
(       d  [
        ?f f = f)ak  
Generate a specialized dict unstructuring function for an attrs class or a
dataclass.

Any provided overrides are attached to the generated function under the
`overrides` attribute.

:param _cattrs_omit_if_default: if true, attributes equal to their default values
    will be omitted in the result dictionary.
:param _cattrs_use_alias: If true, the attribute alias will be used as the
    dictionary key by default.
:param _cattrs_include_init_false: If true, _attrs_ fields marked as `init=False`
    will be included.

.. versionadded:: 23.2.0 *_cattrs_use_alias*
.. versionadded:: 23.2.0 *_cattrs_include_init_false*
.. versionchanged:: 25.2.0
    The `_cattrs_use_alias` parameter takes its value from the given converter
    by default.
.. versionchanged:: 26.1.0
    `typing.Annotated[T, override()]` is now recognized and can be used to customize
    unstructuring.
rA   rD   F)rw   rx   ry   rz   )r   r   ra   r   r*   r(   working_setAttributeErrorsetrj   addr2   remove)ru   rm   rw   rx   ry   rz   r{   originrt   mappingr   s              r=   r1   r1      s   @ ^F6<R(EG,,#I{EB"~~"2/B5(44 
OOB/2	


 %<"7/'A

 

 	2". -  5e)4&5* 	2". s   B: C :CC!D c
                   UR                   nSU-   n[        USS5       Hi  n X=R                      n[        USS5      =(       d    [	        U5      n[
        R                  " SS	U5      n[
        R                  " S
SU5      nUS	U 3-  nMk     SU0n0 n/ n/ n/ n/ n[        5       nUS:X  a  [        USS5      nUS:X  a  [        USS5      nUS:X  a  UR                  nUS:X  a  UR                  nU(       a  UUS'   [        US'   U(       Ga  UR                  S5        UR                  S5        UR                  S5        [        US'   [        US'   U  GH  nUR                  nUU
;   a  U
U   nO)[        UR                   ["        5      nU["        :w  a  UU
U'   UR$                  (       a  MX  UR$                  c  UR&                  (       d	  U	(       d  M  UR                   n[)        U[*        5      (       a  UR-                  UR                   U5      nO<[/        U5      (       a,  [1        U5      (       d  [3        U5      (       d  [5        UX15      nUR6                  b  UR6                  nO[9        UUX&5      nSU 3nUb  UUU'   UR:                  nUR<                  c)  U(       d  UOUR:                  nUU:w  a  [?        UUS9U
U'   OUR<                  nURA                  U5        Sn UR&                  (       Gd,  URB                  [D        La  UR                  U  SU S35        U  S3n UR                  U  S35        U  S3n SU 3n!UUU!'   Ub^  UURF                  :X  a#  UUU'   UR                  U  SU S U S!U S"35        OESU 3n"UUU"'   UR                  U  SU S U S!U S#U" S$3
5        OUR                  U  SU S%U S&35        U SS' n UR                  U  S(35        U  S3n UR                  U  S)URH                   S*U S+U S,U S-3
5        UR                  U  S.35        GM  URB                  [D        La  UR                  U  SU S35        U  S3n UR                  U  S35        U  S3n SU 3n!UUU!'   U(       aT  UURF                  :X  a#  UUU'   UR                  U  S/U S0U S!U S"35        O;UR                  U  S/U S0U S!U S#U! S$3
5        OUR                  U  S/U S1U S&35        U SS' n UR                  U  S(35        U  S3n UR                  U  S)URH                   S*U S+U S,U S-3
5        UR                  U  S.35        GM     U(       a  U/ S2Q-  nUR                  S3U< S435        U(       d-  S5/S6/-   U V#s/ s H  n#S7U# 3PM
     sn#-   S8/-   S9U< S:3/-   n$GOS5/S;/-   U V#s/ s H  n#S7U# 3PM
     sn#-   S8/-   S9U< S:3/-   n$UR                  S<5        GO/ n%U  GH  nUR                  nUU
;   a  U
U   nO)[        UR                   ["        5      nU["        :w  a  UU
U'   UR$                  (       a  MX  UR$                  c  UR&                  (       d	  U	(       d  M  URB                  [D        La  U%R                  U5        M  UR                   n[)        U[*        5      (       a  UR-                  UR                   U5      nO<[/        U5      (       a,  [1        U5      (       d  [3        U5      (       d  [5        UX15      nUR6                  b  UR6                  nO[9        UUX&5      nUR<                  c)  U(       d  UOUR:                  nUU:w  a  [?        UUS9U
U'   OUR<                  nURA                  U5        UR&                  (       df  UbF  SU 3nUUU'   UURF                  :X  a  UUU'   S=U S U S!U S"3n&O#SU 3n"UUU"'   S=U S U S!U S#U" S$3	n&O	S=U S%U S&3n&UR                  U&5        GM  U(       a>  SU 3nUUU'   UURF                  :X  a  UUU'   U S!U S>3n'OSU 3n"UUU"'   U S!U S#U" S?3n'OS@U SA3n'URJ                  (       a  UR:                   SBU' 3n'UR                  U'5        GM     U%(       Ga  UR                  S5        UR                  S5        U% GHz  nUR                  nU
R-                  U["        5      nUR                   n[)        U[*        5      (       a  UR-                  UR                   U5      nO<[/        U5      (       a,  [1        U5      (       d  [3        U5      (       d  [5        UX15      nUR6                  b  UR6                  nO[9        UUX&5      nSU 3nUUU'   UR<                  c)  U(       d  UOUR:                  nUU:w  a  [?        UUS9U
U'   OUR<                  nURA                  U5        UR&                  (       d  UR                  SCU S35        U(       a^  UURF                  :X  a#  UUU'   UR                  SDU S U S!U S"35        GM  SU 3n"UUU"'   UR                  SDU S U S!U S#U" S$3	5        GM  UR                  SDU S%U S&35        GM  UR                  SCU S35        U(       ar  UURF                  :X  a-  UUU'   UR                  SEUR:                   S0U S!U S"35        GM#  SU 3n"UUU"'   UR                  SEUR:                   S0U S!U S#U" S$3	5        GMX  UR                  SEUR:                   S1U S&35        GM}     U(       d  SF/U V#s/ s H  n#SGU# 3PM
     sn#-   SH/-   n$O/SI/U V#s/ s H  n#SGU# 3PM
     sn#-   SH/-   n$UR                  S<5        U(       a  U/ SJQ-  nSKRM                  U V s/ s H
  n U  SBU  3PM     sn 5      n(URO                  U5        SLU SMU( SN3/UQUQU$QUQn)SORM                  U)5      n*[Q        USPU(       a  U)O/ SQ9n+[S        [U        U*U+SR5      U5        UU   n,U
U,l+        U,$ ! [         a    UR                   n[        SU S3U5      Sef = fs  sn#f s  sn#f s  sn#f s  sn#f s  sn f )Sa  
Generate a specialized dict structuring function for a list of attributes.

Usually used as a building block by more specialized hook factories.

Any provided overrides are attached to the generated function under the
`overrides` attribute.

:param _cattrs_forbid_extra_keys: Whether the structuring function should raise a
    `ForbiddenExtraKeysError` if unknown keys are encountered.
:param _cattrs_use_linecache: Whether to store the source code in the Python
    linecache.
:param _cattrs_prefer_attrib_converters: If an _attrs_ converter is present on a
    field, use it instead of processing the field normally.
:param _cattrs_detailed_validation: Whether to use a slower mode that produces
    more detailed errors.
:param _cattrs_use_alias: If true, the attribute alias will be used as the
    dictionary key by default.
:param _cattrs_include_init_false: If true, _attrs_ fields marked as `init=False`
    will be included.

.. versionadded:: 24.1.0
.. versionchanged:: 25.2.0
    The `_cattrs_use_alias` parameter takes its value from the given converter
    by default.
.. versionchanged:: 26.1.0
    `typing.Annotated[T, override()]` is now recognized and can be used to customize
    unstructuring.

structure___parameters__ z"Missing type for generic argument z, specify it when structuring.Nr`   z[\[\.\] ,<>]_z\|u__clrA   forbid_extra_keysFrD   __c_a__c_fekez
  res = {}z  errors = []z**res,__c_cve__c_avn__c_structure_rE   z  zif 'z' in o:ztry:	__c_type_rJ   z = z(o['z'])z'], rI   z = o['z']zexcept Exception as e:zHe.__notes__ = getattr(e, '__notes__', []) + [__c_avn("Structuring class z @ attribute z", "z", __c_type_z)]zerrors.append(e)zres['rQ   z'] = o[')(  unknown_fields = set(o.keys()) - __c_a  if unknown_fields:z5    errors.append(__c_feke('', __cl, unknown_fields))z2  if errors: raise __c_cve('While structuring ' + z, errors, __cl)z  try:z    return __cl(z          )z@  except Exception as exc: raise __c_cve('While structuring ' + z, [exc], __cl)z    instance = __cl(z  return instancez  instance.z']),z),zo['z'],rU   z  if 'z    instance.rP   z  return __cl(rY   z  )z  instance = __cl()r   r   z,    raise __c_feke('', __cl, unknown_fields)rT   rV   z(o, _=__cl, rW   r[   	structurer]   r_   ),r`   ra   KeyErrorr#   strresubr   detailed_validation_prefer_attrib_convertersr    rn   r   r   rb   r,   rc   r)   r:   rd   rg   r   getr   r   r   r   r;   r-   re   r9   r   r   rf   r   _structure_call__qualname__kw_onlyro   updater+   rq   rr   rs   )-rt   ru   rm   rv   _cattrs_forbid_extra_keysrx    _cattrs_prefer_attrib_converters_cattrs_detailed_validationry   rz   r{   cl_namer|   p	name_basepnrb   r   r}   r^   
post_linespi_linesr~   allowed_fieldsr   anr>   r   r   struct_handler_nameianr   r   	type_nametnr   instantiation_linesnon_requiredpi_lineinvocation_liner   r   r   r   r   s-                                                r=   r0   r0   H  sk   Z kkGW$G R)2.	#JJ/I y*d3Es9~ vvosD1vveS$'Qtf:! /$ !"EEJHUN $44$+I7JE$R!,,#I{EB"&66&/&C&C#'+;;+4+N+N( 'g3j"\"_%)(<9%(?9%ABV|!":9!&&'Jw&!)F2J}}}}$QVV<VA!W%%OOAJJ2Awqzz,q//"1k6
 ##/"..0q) %32$"7":A"#67''C&0Ragg8!'!<F2J__r"A66699G+OOqcbT$9:#RA1#T
+cH't,	01"9-&)";";;BC*+>?  c2$c2E1Fd2$cR  )-12*2.  c2$c2E1Fd2$dSURVVWX OOqc2$fRD$CDcrF1#%; <=cHccdfdsdsct  uB  CE  BF  FJ  KM  JN  NZ  []  Z^  ^`  a 1#%5 67 99G+LLA3d2$g!67#RAs$Z(cH't,	01"9-)";";;BC*+>? cse51D0ET"SQ  cse51D0ET"TR[Q\\]^ LLA3eC5B!?@crFs"89:cHccdfdsdsct  uB  CE  BF  FJ  KM  JN  NZ  []  Z^  ^`  a s"234K N %  J 	@?[	
 
%&'/?@/?tVD6?/?@A )
 WW^Vaaop	   
)*+/?@/?tVD6?/?@A )
 WW^Vaaop	   OO/0ABV|!":9!&&'Jw&!)F2J}}}}$QVV<Vyy'##A&A!W%%OOAJJ2Awqzz,q//"1k6
 ##/"..0q) &0Ragg8!'!<F2J__r"66&,:2$*?'>E&':;)";";;BC*+>?$/t37J6K4PRtSV"W(-12*2.)"S1D0ET"TRTQUUVW   !,B4vbT<G(,:2$*?'>E&':;)";";;BC*+>?-@,AbT*N(-12*2.-@,AbTbTQS*T(+B4smO99)*	?2C&DO ''8] b ##H-LL&!VV!::b'2FFa))#

A6A]]71::l1oo&q+:A
 ''3&22G41iG )7rd&;#:A"#67??*#4!''BRx%+HR%@r
!B""2&vvOOfRD$89"i&?&??FG./BC$OO"/t37J6K4PRtSV W $-RD!1B56.r2$OO"/t37J6K4PRtSWXZW[[\ ] !-t6"R(HI%%rd'&:;"i&?&??FG./BC&--"+AGG9E:M9NdSURVVY Z $-RD!1B56.r2&--"+AGG9E:M9NdSURVVZ[]Z^^_ ` #))IaggYhrd"*MN{ "| !"-=>-=TT$=-=>?'   &&-=>-=TT$=-=>?'  
 OO/0$  J 		7I"J7I!aS!:7I"JK	LL#$ wi|$5#6b9	 
 
	
 
K YY{#F$
K.C{E 		'/
.CCMJc  	B/4RD8VW 	~ A A@ ? ? #Ks)   p;q (q+q

qq(p=c           
     x   0 n	[        U 5      (       a  [        U 5      n
[        X	5      n	U
b  U
n [        U SS5       HA  n
[        U
5      (       d  M  [	        U
5      R                  S5      (       a  M6  [        X5      n	  O   [        U 5      n [        R                  nX;   a
  [        5       e UR                  U 5         [        UU UU	4UUUUUUS.UD6UR                  U 5        U(       d  [        ?$ $ ! [         a    [        5       nU[        l         Nhf = f! UR                  U 5        U(       d  [        ?f f = f)a  
Generate a specialized dict structuring function for an attrs class or
dataclass.

Any provided overrides are attached to the generated function under the
`overrides` attribute.

:param _cattrs_forbid_extra_keys: Whether the structuring function should raise a
    `ForbiddenExtraKeysError` if unknown keys are encountered.
:param _cattrs_use_linecache: Whether to store the source code in the Python
    linecache.
:param _cattrs_prefer_attrib_converters: If an _attrs_ converter is present on a
    field, use it instead of processing the field normally.
:param _cattrs_detailed_validation: Whether to use a slower mode that produces
    more detailed errors.
:param _cattrs_use_alias: If true, the attribute alias will be used as the
    dictionary key by default.
:param _cattrs_include_init_false: If true, _attrs_ fields marked as `init=False`
    will be included.

.. versionadded:: 23.2.0 *_cattrs_use_alias*
.. versionadded:: 23.2.0 *_cattrs_include_init_false*
.. versionchanged:: 23.2.0
    The `_cattrs_forbid_extra_keys` and `_cattrs_detailed_validation` parameters
    take their values from the given converter by default.
.. versionchanged:: 24.1.0
    The `_cattrs_prefer_attrib_converters` parameter takes its value from the given
    converter by default.
.. versionchanged:: 25.2.0
    The `_cattrs_use_alias` parameter takes its value from the given converter
    by default.
.. versionchanged:: 26.1.0
    `typing.Annotated[T, override()]` is now recognized and can be used to customize
    unstructuring.
__orig_bases__r   ztyping.Generic)r   rx   r   r   ry   rz   )r   r   r*   ra   r   
startswithr   r(   r   rj   r   r   r   r0   r   )ru   rm   r   rx   r   r   ry   rz   r{   r   basert   r   s                r=   r/   r/     sM   b G"~~"~"2/B,b1dCI$8$89I$J$J&t5G 2
 2E#(44
  ""  OOB/0	

 '@"7-M(C/'A
 
 	2". 3  5e)4&50 	2". s   C3 >D 3DD!D9.r   HeteroTupleUnstructureFnc                   SnUc  [        U 5      OUnU Vs/ s H  oQR                  U5      PM     nn[        U5       VVs0 s H  u  pxSU 3U_M     n	nnU[        La  U=(       d    U U	S'   / n
U
R	                  SU S35        U[        La  U
R	                  S5        OU
R	                  S5        [        [        U5      5       H>  nXg   [        :X  a  U
R	                  SU S	35        M&  U
R	                  S
U SU S35        M@     U[        La  U
R	                  S5        OU
R	                  S5        / U
QSPn[        [        SR                  U5      SS5      U	5        X   $ s  snf s  snnf )zGenerate a specialized unstructure function for a heterogenous tuple.

:param type_args: If provided, override the type arguments.
unstructure_tuple
__cattr_u___cattr_seq_clrV   z(tup):z    res = __cattr_seq_cl((z    res = (z        tup[z],z        __cattr_u_z(tup[z]),z    ))r       return resr[    r_   )r   ri   	enumeratetuplern   rangelenr$   rq   rr   ro   )ru   rm   unstructure_to	type_argsr|   type_arghandlersr   hr}   r^   r   s               r=   r3   r3   Y  sc    "G ) 1yI JSSX..x8HS-6x-@A-@TQz!q -@EAU""0"6BE	LL4y'(U"12]#3x=!;("LL<s"-.LL-aSaS<=	 " U"XW,E,+,K;'V	4e<>7 TAs   E"E'c                   U=(       d    UR                   nUR                   nSnU n[        U SS5      br  [        U 5      n[        U5      S:X  a  Uu  pOU[        pU=(       d    UR                  U	SS9nU[        :X  a  SnUR                  U
SS9nU[        :X  a  Sn[        U 5      nXES.nUb  SOS	nUb  S
OSnSU S3/nU[        L d  Uc.  U[        L a%  Uc	  Uc  [        $ UR                  SU SU S35        O,U=(       d    U US'   UR                  SU SU S35        / UQSPn[        [        SR                  U5      SS5      U5        X   $ )zGenerate a specialized unstructure function for a mapping.

:param unstructure_to: The class to unstructure to; defaults to the
    same class as the mapping being unstructured.
unstructure_mapping__args__Nr   FrF   )__cattr_k_u__cattr_v_uz__cattr_k_u(k)r   z__cattr_v_u(v)r   rV   z
(mapping):z    return {:  for k, v in mapping.items()}__cattr_mapping_clz    res = __cattr_mapping_cl((rT   z) for k, v in mapping.items())r   r[   r   r_   )r\   ra   r   r   r   ri   r$   r   dictrn   rq   rr   ro   )ru   rm   r   key_handlerkhval_handlerr|   r   argskey_argval_argr}   k_uv_ur^   s                  r=   mapping_unstructure_factoryr     s    
	-	--B''K#GF r:t$0|t9>#GW  $SWWI::7QV:W>B44W54Q("KB;E n
#C)5
3CG9J'(E."8Vt^:+-K}SEC50NOP&4&:"#,SEC58VW	
 +%*)*5!2v	.6>r?   r	   r6   c                   SnUS:X  a  UR                   nSU0n/ n0 n	[        U 5      (       d  [        U 5      n
[        U
5      S:X  a  U
u  pU[        L a  UnU[        L a  UnO8U[        La  U[        L a  U
u  nO!U[        L a  U[        La  U
u  nO
U
u  n[
        nU[        ;   =(       a	    U[        ;   nU(       dd  UR                  USS9nXR                  :X  a  UnUR                  USS9nXR                  :X  a  UnX7S'   XGS'   XS	'   XS
'   X:w  a  SOSnX:w  a  SOSnOSnU(       a  UR                  S5        GOU(       Gah  [        U	S'   [        U	S'   U[        La  UO[
        U	S'   U[        La  UO[
        U	S'   [        US'   UR                  S5        UR                  S5        UR                  S5        UR                  SW 35        UR                  S5        UR                  S5        UR                  S5        UR                  S5        UR                  S5        UR                  SW 35        UR                  S5        UR                  S5        UR                  S 5        UR                  S5        UR                  S!5        UR                  S"[        U 5      < S#35        OUR                  S$W S%W S&35        U[        La  UR                  S'5        S(R                  U	 Vs/ s H
  nU S)U 3PM     sn5      nU(       a  S(U 3nU	R!                  5        H  u  nnUUU'   M     XS*'   S+U S,U S-3nU/UQS.PnS/R                  U5      n[#        [%        US0S15      U5        Xv   $ s  snf )2z8Generate a specialized structure function for a mapping.structure_mappingrA   r   r   FrF   __cattr_k_t__cattr_v_t__cattr_k_s__cattr_v_sz__cattr_k_s(k, __cattr_k_t)z__cattr_k_s(k)z__cattr_v_s(v, __cattr_v_t)z__cattr_v_s(v)Tz  res = dict(mapping)r!   r"   val_typekey_typer   z  res = {}; errors = []z  for k, v in mapping.items():z    try:z      value = z    except Exception as e:z      e.__notes__ = getattr(e, '__notes__', []) + [IterableValidationNote(f'Structuring mapping value @ key {k!r}', k, val_type)]z      errors.append(e)z      continuez      key = z      res[key] = valuez      e.__notes__ = getattr(e, '__notes__', []) + [IterableValidationNote(f'Structuring mapping key @ key {k!r}', k, key_type)]z  if errors:z9    raise IterableValidationError('While structuring ' + z, errors, __cattr_mapping_cl)rX   r   r   z  res = __cattr_mapping_cl(res)rT   rU   ru   rV   z(mapping, cl=clrW   rZ   r[   r   r_   )r   r   r   r   r   r   r   get_structure_hookr   rn   r!   r"   r   reprr   ro   rp   rq   rr   )ru   rm   structure_tor   r   r   r|   r}   r^   r   r   key_arg_candval_arg_candis_bare_dictr   r   k_sv_sr   r   r   r   def_liner   r   s                            r=   mapping_structure_factoryr    s    "G..';;2LAEE 2;;|t9>)-&L7"'7"'w&8w+>"W$)@" #5(>X->#66xe6TK777&#66xe6TK777&#+- #+- #.- #.-  * .%  * .%  ,-<S89;Q78$G3 z* %G3 z* "+E+LL23LL9:LL$LL>#/0LL56LL T LL12LL)*LL$LL<u-.LL12LL56LL R LL12LL(LLKDQSH<Wtu LL:cU"SE1OPQ467		7I"J7I!aS!:7I"JK !2 34"((*1a + $KgYo.?-@CH4e4^4KYY{#FV	$e,> #Ks   ,M/r5   c                2   UR                   n[        U SS5      S;  ai  U R                  S   n[        U[        5      (       a   [        US[
        5      nU[        L a  [
        nUR                  USS9nU[        :X  a  U=(       d    U $ U=(       d    U U4S jnU$ )	zA hook factory for unstructuring iterables.

:param unstructure_to: Force unstructuring to this type, if provided.

..  versionchanged:: 24.2.0
    `typing.NoDefault` is now correctly handled as `Any`.
r   N)Nr   r   __default__FrF   c                (   ^ U" U4S jU  5       5      $ )Nc              3  4   >#    U  H  nT" U5      v   M     g 7fNr   ).0r   _hooks     r=   	<genexpr>Miterable_unstructure_factory.<locals>.unstructure_iterable.<locals>.<genexpr>g  s     2AuQxxs   r   )iterable_seq_clr  s     `r=   unstructure_iterable:iterable_unstructure_factory.<locals>.unstructure_iterablef  s    2222r?   )	r\   ra   r   rg   r   r   r   ri   r$   )ru   rm   r   r   r   r  s         r=   iterable_unstructure_factoryr  L  s     ##G
 r:t$J6;;q>h((x<H9$000Nh!'R'/=/C7 3  r?   r4   )NNNNN)r8   bool | Noner9   z
str | Noner:   r  r;   z Callable[[Any, Any], Any] | Noner<   zCallable[[Any], Any] | Nonereturnr'   )rt   list[Attribute]ru   type[T]rm   r.   rv   dict[str, Any]rw   boolrx   r  ry    bool | Literal['from_converter']rz   r  r{   r'   r  Callable[[T], dict[str, Any]])FTrA   F)ru   r  rm   r.   rw   r  rx   r  ry   r  rz   r  r{   r'   r  r  )rt   r  ru   r  rm   r.   rv   r  r   r  rx   r  r   r  r   r  ry   r  rz   r  r{   r'   r  )SimpleStructureHook[Mapping[str, Any], T])rA   TrA   rA   rA   F)ru   r  rm   r.   r   r  rx   r  r   r  r   r  ry   r  rz   r  r{   r'   r  r  )NN)
ru   r   rm   r.   r   r   r   ztuple | Noner  r   )
ru   r   rm   r.   r   r   r   z'Callable[[Any, Any | None], Any] | Noner  MappingUnstructureFn)
ru   r  rm   r.   r   rc   r   r  r  z)SimpleStructureHook[Mapping[Any, Any], T]r  )ru   r   rm   r.   r   r   r  r   )N
__future__r   r   collections.abcr   r   r   typingr   r   r	   r
   r   rt   r   r   r   r   r   typing_extensionsr   _compatr   r   r   r   r   r   r   r   r   	_genericsr   dispatchr   errorsr   r   r    r!   r"   r#   fnsr$   typesr%   _constsr'   r(   r)   r*   _lcr+   _sharedr,   r-   
convertersr.   __all__r>   r@   r2   r1   r0   r/   IterableUnstructureFnr   r   __annotations__r3   r  r   r6   r   r  r5   r  r4   r   r?   r=   <module>r1     sJ   " 	 7 7 > > @ @ '
 
 
 ' &   ' C C ' ) K*	 $(4815X XX X 2	X
 /X X CL #%$)"&:J',ttt t  	t
 "t  t 8t !%t  t #tt %*"&:J',H/H/H/ "H/  	H/
 8H/ !%H/  H/ #H/^ #%BR"& 	DT:J',ggg g  	g
  @g  g 	)g "Bg 8g !%g  g /gZ CS"& 	DT:J',]/]/]/  @]/  	]/ 	)]/ "B]/ 8]/ !%]/  ]/ /]/@ !(3-#!56  '/c3h/@#/E&F ) F "	*** * 	*
 *Z  c!2 3S 89  ;?	;;; ; 9	;
 ;| &A U @ <Lyyy y :y /yx $= 5 <
 >B  % 7:  @ 'C e Br?   