
    hy                   L   S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKJrJr  S SKJr  S SKJrJrJr  SSKJrJrJr  SSKJrJrJrJrJrJr  SS	KJ r J!r!J"r"J#r#  \$RJ                  r&S
r'Sr(Sr)\
RT                  " 0 5      r+\$" 5       r,\RZ                  " \R\                  \R^                  5      r0 " S S\Rb                  5      r2\2Rf                  r3  " S S\45      r5\3SSSSSSSSSSSSSS4S jr6  SR         SSS jjr7 ST         SUS jjr8SVS jr9 " S S\5      r:S r;S r<  SWS jr=S r>  SXS jr?S r@S rAS  rBS! rC " S" S#5      rDS$ rES% rF SYS& jrG                        SZS' jrH\HrI S( rJS[S) jrK          S\S* jrLS]S+ jrMS, rNS^S- jrOS. rPSTS/ jrQS_S0 jrRS`S1 jrSS2 rTS3 rUS4 r/S5 rV  SaS6 jrWSbS7 jrX          ScS9 jrYSdS: jrZ          ScS; jr[      SeS< jr\                          SfS= jr]SgS> jr^ " S? S@5      r_\_R                   V s/ s H  n \_" U \3SSSSSU SA:g  SS\^" U 5      SB9PM     sn ra\M" \Q" \S" \_\aSC9\a Vs/ s H  oR                  SD:w  d  M  UPM     snSC9\a Vs/ s H)  oR                  (       d  M  UR                  SD:w  d  M'  UPM+     snSC9r_ " SE SF5      rd\Q" \S" \d5      5      rd " SG SH5      re\eR                   V s/ s H  n \_" U \3SSSSSSSSSI9
PM     sn rf\M" \Q" \S" \e\fSC9\fSC9\fSC9re " SJ S85      rgSK V s/ s H  n \_" U \3SSSSSSSSSI9
PM     sn rf\M" \Q" \S" \g\fSC9\fSC9\fSC9rg\$4S4SL jrh\H" SSSM9 " SN SO5      5       riSP rjSQ r-gs  sn f s  snf s  snf s  sn f s  sn f )h    )annotationsN)CallableMapping)cached_property)Any
NamedTupleTypeVar   )_compat_configsetters)PY_3_10_PLUSPY_3_11_PLUSPY_3_13_PLUS_AnnotationExtractor_get_annotationsget_generic_base)DefaultAlreadySetErrorFrozenInstanceErrorNotAnAttrsClassErrorUnannotatedAttributeErrorz__attr_factory_%s)ztyping.ClassVarz
t.ClassVarClassVarztyping_extensions.ClassVar_attrs_cached_hashc                  F    \ rS rSrSr\R                  " 5       rS rS r	Sr
g)_Nothing=   a.  
Sentinel to indicate the lack of a value when `None` is ambiguous.

If extending attrs, you can use ``typing.Literal[NOTHING]`` to show
that a value may be ``NOTHING``.

.. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
.. versionchanged:: 22.2.0 ``NOTHING`` is now an ``enum.Enum`` variant.
c                    g)NNOTHING selfs    </var/www/html/env/lib/python3.13/site-packages/attr/_make.py__repr___Nothing.__repr__J   s        c                    g)NFr   r    s    r"   __bool___Nothing.__bool__M   s    r%   r   N)__name__
__module____qualname____firstlineno____doc__enumautor   r#   r'   __static_attributes__r   r%   r"   r   r   =   s     iikGr%   r   c                  2    \ rS rSrSr\" S5      S4S jrSrg)_CacheHashWrapperY   ac  
An integer subclass that pickles / copies as None

This is used for non-slots classes with ``cache_hash=True``, to avoid
serializing a potentially (even likely) invalid hash value. Since `None`
is the default value for uncalculated hashes, whenever this is copied,
the copy's value for the hash should automatically reset.

See GH #613 for more details.
Nr   c                    X4$ Nr   )r!   _none_constructor_argss      r"   
__reduce___CacheHashWrapper.__reduce__e   s     ''r%   )r)   r*   r+   r,   r-   typer8   r0   r   r%   r"   r2   r2   Y   s    	 ,0:R (r%   r2   TFc                Z   [        X;US5      u  pnnUb  USLa  USLa  Sn[        U5      eU	b>  U [        La  Sn[        U5      e[	        U	5      (       d  Sn[        U5      e[        U	5      n Uc  0 n[        U[        [        45      (       a  [        R                  " U6 nU(       a#  [        U[        [        45      (       a  [        U6 nU(       a#  [        U[        [        45      (       a  [        U6 n[        S0 SU _SU_S	U_S
S_SU_SU_SU_SU_SU_SU
_SU_SU_SU_SU_SU_SU_6$ )aC  
Create a new field / attribute on a class.

Identical to `attrs.field`, except it's not keyword-only.

Consider using `attrs.field` in new code (``attr.ib`` will *never* go away,
though).

..  warning::

    Does **nothing** unless the class is also decorated with
    `attr.s` (or similar)!


.. versionadded:: 15.2.0 *convert*
.. versionadded:: 16.3.0 *metadata*
.. versionchanged:: 17.1.0 *validator* can be a ``list`` now.
.. versionchanged:: 17.1.0
   *hash* is `None` and therefore mirrors *eq* by default.
.. versionadded:: 17.3.0 *type*
.. deprecated:: 17.4.0 *convert*
.. versionadded:: 17.4.0
   *converter* as a replacement for the deprecated *convert* to achieve
   consistency with other noun-based arguments.
.. versionadded:: 18.1.0
   ``factory=f`` is syntactic sugar for ``default=attr.Factory(f)``.
.. versionadded:: 18.2.0 *kw_only*
.. versionchanged:: 19.2.0 *convert* keyword argument removed.
.. versionchanged:: 19.2.0 *repr* also accepts a custom callable.
.. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
.. versionadded:: 19.2.0 *eq* and *order*
.. versionadded:: 20.1.0 *on_setattr*
.. versionchanged:: 20.3.0 *kw_only* backported to Python 2
.. versionchanged:: 21.1.0
   *eq*, *order*, and *cmp* also accept a custom callable
.. versionchanged:: 21.1.0 *cmp* undeprecated
.. versionadded:: 22.2.0 *alias*
TNF6Invalid value for hash.  Must be True, False, or None.z=The `default` and `factory` arguments are mutually exclusive.z*The `factory` argument must be a callable.default	validatorreprcmphashinit	convertermetadatar:   kw_onlyeqeq_keyorder	order_key
on_setattraliasr   )_determine_attrib_eq_order	TypeErrorr   
ValueErrorcallableFactory
isinstancelisttupler   pipeand__CountingAttr)r=   r>   r?   r@   rA   rB   rD   r:   rC   factoryrE   rF   rH   rJ   rK   rG   rI   msgs                     r"   attribrY   i   s   n $>$ By D,U1BFn'!O  S/!  >CS/!'" *tUm,,\\:.
Z	D%=99)$	Z	D%=99)$	   	
             ! r%   c                4    [        XS5      n[        XAU5        g)zO
Evaluate the script with the given global (globs) and local (locs)
variables.
execN)compileeval)scriptglobslocsfilenamebytecodes        r"   _compile_and_evalrc      s     v0H$r%   c                    Uc  0 OUnSnUn [        U 5      SU R                  S5      U4n[        R                  R	                  X5      nX:X  a  OUSS  SU S3nUS-  nMU  [        XXA5        U$ )zH
Cache the script with _linecache_, compile it and return the _locals_.
Nr
   T->)len
splitlines	linecachecache
setdefaultrc   )	r^   ra   r_   localsr`   countbase_filenamelinecache_tupleold_vals	            r"   _linecache_and_compilerr      s     2VD EM
Kd#	
 //,,XG%#CR()5'3
  fT4Kr%   c                    U  S3n0 n[        U5       H  u  pEU4S jn[        U5      X5'   M     [        U[        4U5      $ )z
Create a tuple subclass to hold `Attribute`s for an `attrs` class.

The subclass is a bare tuple with properties for names.

class MyClassAttributes(tuple):
    __slots__ = ()
    x = property(itemgetter(0))

Attributesc                
    X   $ r5   r   )r!   is     r"   getter&_make_attr_tuple_class.<locals>.getter  s	    7Nr%   )	enumeratepropertyr:   rS   )cls_name
attr_namesattr_class_namebodyrv   	attr_namerw   s          r"   _make_attr_tuple_classr     sO     "
*-OD!*- 	 #6* . %400r%   c                  4    \ rS rSr% S\S'   S\S'   S\S'   Srg	)
_Attributesi  r:   attrslist[Attribute]
base_attrsdict[str, type]base_attrs_mapr   N)r)   r*   r+   r,   __annotations__r0   r   r%   r"   r   r     s    K##r%   r   c                    [        U 5      n U R                  S5      (       a  U R                  S5      (       a  U SS n U R                  [        5      $ )z
Check whether *annot* is a typing.ClassVar.

The string comparison hack is used to avoid evaluating all string
annotations which would put attrs-based classes at a performance
disadvantage compared to plain old classes.
)'"r
   re   )str
startswithendswith_CLASSVAR_PREFIXES)annots    r"   _is_class_varr   "  sK     JE 
##z(B(Ba.//r%   c                    XR                   ;   $ )zJ
Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
)__dict__)clsattrib_names     r"   _has_own_attributer   3  s     ,,&&r%   c                   / n0 n[        U R                  SS 5       Hh  n[        US/ 5       HT  nUR                  (       d  UR                  U;   a  M&  UR                  SS9nUR                  U5        XCUR                  '   MV     Mj     / n[        5       n[        U5       HB  nUR                  U;   a  M  UR                  SU5        UR                  UR                  5        MD     Xc4$ )zI
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
r
   re   __attrs_attrs__T	inheritedr   )
reversed__mro__getattrr   nameevolveappendsetinsertadd)r   taken_attr_namesr   base_attr_mapbase_clsafilteredseens           r"   _collect_base_attrsr   :  s     JM S[[2./#4b9A{{aff(884(Aa $,!&&! : 0 H5Dj!66T>1	 " ""r%   c                   / n0 nU R                   SS  Hr  n[        US/ 5       H^  nUR                  U;   a  M  UR                  SS9nUR	                  UR                  5        UR                  U5        XCUR                  '   M`     Mt     X#4$ )a  
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.

N.B. *taken_attr_names* will be mutated.

Adhere to the old incorrect behavior.

Notably it collects from the front and considers inherited attributes which
leads to the buggy behavior reported in #428.
r
   re   r   Tr   )r   r   r   r   r   r   )r   r   r   r   r   r   s         r"   _collect_base_attrs_brokenr   [  s     JM KK"%#4b9Avv))4(A  (a $,!&&! : & $$r%   c                  ^ U R                   m[        U 5      nUb  [        UR                  5       5      nGO$USL a  TR                  5        VV	s1 s H  u  pU	R                  [
        L d  M  UiM     n
nn	/ n[        5       nUR                  5        Hn  u  p[        U5      (       a  M  UR                  U5        TR                  U[        5      nUR                  [
        La  [        U5      nUR                  X45        Mp     X-
  nU(       a,  [        SSR                  [        UU4S jS95      -   S-   5      eO [        S TR                  5        5       S S9n[         R"                  nU VVs/ s H  u  nnU" UUUR                  U5      5      PM!     nnnU(       a*  [%        U U Vs1 s H  oR&                  iM     sn5      u  nnO)[)        U U Vs1 s H  oR&                  iM     sn5      u  nnU(       a<  U Vs/ s H  oR+                  SS	9PM     nnU Vs/ s H  oR+                  SS	9PM     nnUU-   nUb  [-        U" U U5      5      nS
nS U 5        HJ  nUSL a$  UR.                  [        L a  SU< 3n[1        U5      eUS
L d  M3  UR.                  [        Ld  MH  SnML     U HE  nUR2                  (       a  M  [4        R7                  U5      " S[9        UR&                  5      5        MG     U Vs/ s H  oR&                  PM     nn[;        U R<                  U5      n[?        U" U5      UU5      $ s  sn	nf s  snnf s  snf s  snf s  snf s  snf s  snf )a  
Transform all `_CountingAttr`s on a class into `Attribute`s.

If *these* is passed, use that and don't look for them on the class.

If *collect_by_mro* is True, collect them in the correct MRO order,
otherwise use the old -- incorrect -- order.  See #428.

Return an `_Attributes`.
Tz1The following `attr.ib`s lack a type annotation: , c                :   > TR                  U 5      R                  $ r5   )getcounter)ncds    r"   <lambda>"_transform_attrs.<locals>.<lambda>  s    bffQi6G6Gr%   )key.c              3  V   #    U  H  u  pUR                   [        L d  M  X4v   M!     g 7fr5   )	__class__rV   ).0r   attrs      r"   	<genexpr>#_transform_attrs.<locals>.<genexpr>  s)      ",JD>>]2 ",s   )
)c                     U S   R                   $ Nr
   )r   )es    r"   r   r     s    !A$,,r%   )rE   Fc              3  h   #    U  H(  oR                   S Ld  M  UR                  S L d  M$  Uv   M*     g7f)FN)rB   rE   r   r   s     r"   r   r     s(     MA&&"5a!))u:Laas   22	2zlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: rK   ) r   r   rR   itemsr   rV   r   r   r   r   r   rY   r   r   joinsorted	Attributefrom_counting_attrr   r   r   r   rS   r=   rN   rK   _OBJ_SETATTR__get___default_init_alias_forr   r)   r   )r   theseauto_attribsrE   collect_by_mrofield_transformerannsca_listr   r   ca_namesannot_namesr   r:   r   unannotatedfcaca	own_attrsr   r   r   had_defaultrX   r|   
AttrsClassr   s                             @r"   _transform_attrsr   w  s2    
BC Du{{}%		 !hhj
(
~~. ( 	 

 e#zz|OIT""OOI&y'*A{{-/1INNI>*  , ,+C));,GH 	   "$((*
 '
 
&
&CELELMIrIr488I./W   $7),)Q&&),%
!
M %?),)Q&&),%
!
M 5>?YXXdX+Y	?6@Ajhhth,j
A"E$'U34 KMM$199#7 A  BC  AF  GCS/!%AIIW$<K N www  #G-DQVV-LM  #((%Q&&%J('jAJz%(*mDDm
J - - @A> )s0   L8,L80&L>*M
M	
>MM8Mc                    / SQnUb  UR                  S5        OUR                  / SQ5        UR                  SS/5        [        US5      nU [        R                  US.n[        SR                  U5      XES	U0S
9S   $ )N)	zdef wrapper(_cls):z    __class__ = _clsz    def __getattr__(self, item, cached_properties=cached_properties, original_getattr=original_getattr, _cached_setattr_get=_cached_setattr_get):z+         func = cached_properties.get(item)z         if func is not None:z!              result = func(self)z1              _setter = _cached_setattr_get(self)z#              _setter(item, result)z              return resultz,         return original_getattr(self, item))z         try:z2             return super().__getattribute__(item)z         except AttributeError:z4             if not hasattr(super(), '__getattr__'):z                 raisez-             return super().__getattr__(item)zY         original_error = f"'{self.__class__.__name__}' object has no attribute '{item}'"z-         raise AttributeError(original_error)z    return __getattr__z__getattr__ = wrapper(_cls)r   )cached_properties_cached_setattr_getoriginal_getattr
_cls)rm   __getattr__)r   extend_generate_unique_filenamer   r   rr   r   )r   r   r   linesunique_filenameglobs         r"   _make_cached_property_getattrr     s    E #:	
 			
 
LL$)	
 0Y?O /+33,D "		%/ r%   c                r    [        U [        5      (       a  US;   a  [        R                  XU5        g[        e)z,
Attached to frozen classes as __setattr__.
)	__cause____context____traceback____suppress_context__	__notes__N)rQ   BaseException__setattr__r   r!   r   values      r"   _frozen_setattrsr     s8     $&&4 4 , 	!!$e4
r%   c                p    [        U [        5      (       a  US;   a  [        R                  X5        g[        e)z,
Attached to frozen classes as __delattr__.
)r   N)rQ   r   __delattr__r   )r!   r   s     r"   _frozen_delattrsr   (  s/     $&&4>+A!!$-
r%   c                 ,    U u  nUR                  n[	        U5      nU HB  nUR
                  (       d  M  UR                  nUR                  nX;  d  M5  [        X'5      X'   MD     U" S0 UD6$ ! [          a    S[        U 5       S3n[        U5      Sef = f)a  
Create a new instance, based on the first positional argument with
*changes* applied.

.. tip::

   On Python 3.13 and later, you can also use `copy.replace` instead.

Args:

    inst:
        Instance of a class with *attrs* attributes. *inst* must be passed
        as a positional argument.

    changes:
        Keyword changes in the new copy.

Returns:
    A copy of inst with *changes* incorporated.

Raises:
    TypeError:
        If *attr_name* couldn't be found in the class ``__init__``.

    attrs.exceptions.NotAnAttrsClassError:
        If *cls* is not an *attrs* class.

.. versionadded:: 17.1.0
.. deprecated:: 23.1.0
   It is now deprecated to pass the instance using the keyword argument
   *inst*. It will raise a warning until at least April 2024, after which
   it will become an error. Always pass the instance as a positional
   argument.
.. versionchanged:: 24.1.0
   *inst* can't be passed as a keyword argument anymore.
z*evolve() takes 1 positional argument, but z were givenNr   )	rN   rh   rM   r   fieldsrB   r   rK   r   )	argschangesinstrX   r   r   r   r   	init_names	            r"   r   r   3  s    J' ..C3KEvvFF	GG	#!(!9G  >>!  '8T;O 	 n$&	's   A- -&Bc                      \ rS rSrSrSr  SS jrS rSS j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S rS rS rSS jrSS jrSrg)_ClassBuilderim  z 
Iteratively build *one* class.
)_add_method_dunders_attr_names_attrs_base_attr_map_base_names_cache_hashr   	_cls_dict_delete_attribs_frozen_has_custom_setattr_has_post_init_has_pre_init_is_exc_on_setattr_pre_init_has_args_repr_added_script_snippets_slots_weakref_slot_wrote_own_setattrc                   [        UUUUUU5      u  nnnXl        U(       a  [        UR                  5      O0 U l        Xl        U Vs1 s H  nUR                  iM     snU l        UU l        [        S U 5       5      U l
        X0l        X@l        XPl        Xl        [        [!        USS5      5      U l        SU l        U R"                  (       a?  UR&                  n[(        R*                  " U5      n[-        UR.                  5      S:  U l        [        [!        USS5      5      U l        [        U5      (       + U l        Xl        Xl        Xl        SU l        U R
                  U R                  S'   U(       a.  [<        U R                  S'   [>        U R                  S'   S	U l        OU[@        [B        RD                  [B        RF                  4;   a  S=nnU H3  nURH                  b  S	nURJ                  b  S	nU(       d  M*  U(       d  M3    O   U[@        :X  a  U(       d  U(       a6  U[B        RD                  :X  a  U(       a  U[B        RF                  :X  a  U(       d  S U l        U(       a-  U RM                  5       u  U R                  S
'   U R                  S'   / U l'        SU l(        [S        U R                  S5      (       a  [S        U R                  S5      (       d  U RT                  U l+        g U RX                  U l+        g s  snf )Nc              3  8   #    U  H  oR                   v   M     g 7fr5   r   r   s     r"   r   )_ClassBuilder.__init__.<locals>.<genexpr>  s      7As   __attrs_pre_init__Fr
   __attrs_post_init__r   r   r   T__getstate____setstate__r*   r+   )-r   r   dictr   r  r   r   r  r   rS   r   r  r  r  r  boolr   r  r  r  inspect	signaturerh   
parametersr  r  r	  r
  r  r  r   r   _DEFAULT_ON_SETATTRr   validateconvertr>   rC   _make_getstate_setstater  r  hasattr_add_method_dunders_safer   _add_method_dunders_unsafe)r!   r   r   slotsfrozenweakref_slotgetstate_setstater   rE   
cache_hashis_excr   rJ   has_custom_setattrr   r   r   base_mapr   pre_init_funcpre_init_signaturehas_validatorhas_converters                          r"   __init___ClassBuilder.__init__  s   " '7'
#z8 	/4cll+",67JqAFFJ7&  7 77)%!'#/CU"KL"'  22M!(!2!2=!A&)*<*G*G&H1&LD#"730Eu#MN#';%#5 "',0KK(),<DNN=),<DNN=)&*D#OO
 

 -21MM;;*$(M;;*$(M =]]  "55*m'"2"22='//1-
 $(  ,,.~.~.  	 ! tyy,//wII~8
 8
 (,'D'DD$'+'F'FD$Y 8s   K<c                6    SU R                   R                   S3$ )Nz<_ClassBuilder(cls=z)>)r   r)   r    s    r"   r#   _ClassBuilder.__repr__  s    $TYY%7%7$8;;r%   c                P   SR                  U R                   Vs/ s H  oS   PM	     sn5      n0 nU R                   H  u  pEnUR                  U5        M     [        U[	        U R
                  S5      U5      nU R                   H  u    pGU" U R                  U5        M     gs  snf )z-
Evaluate any registered snippets in one go.
r   r   methodsN)r   r  updaterr   r   r   r  )r!   snippetr^   r_   _snippet_globsr`   hooks           r"   _eval_snippets_ClassBuilder._eval_snippets  s     d6K6KL6K7AJ6KLM#'#8#8AaLL' $9 &%dii;
 //JAq& 0 Ms   B#c                ,   U R                  5         U R                  SL a  U R                  5       nO1U R                  5       n[        (       a  [
        R                  " U5      n[        USS5      (       a   SUR                  ;  a  UR                  5         U$ )zk
Finalize class based on the accumulated configuration.

Builder cannot be used after calling this method.
T__attrs_init_subclass__N)
r<  r  _create_slots_class_patch_original_classr   abcupdate_abstractmethodsr   r   r?  )r!   r   s     r"   build_class_ClassBuilder.build_class
  s|     	;;$**,C,,.C|005
 C2D99)='')
r%   c                (   U R                   nU R                  nU R                  (       aa  U R                   HQ  nX2;  d  M
  [	        X[
        5      [
        Ld  M#  [        R                  " [        5         [        X5        SSS5        MS     U R                  R                  5        H  u  p4[        XU5        M     U R                  (       d5  [	        USS5      (       a#  SUl        U R                  (       d  [         Ul        U$ ! , (       d  f       M  = f)z1
Apply accumulated methods and return the class.
N__attrs_own_setattr__F)r   r  r  r   r   	_SENTINEL
contextlibsuppressAttributeErrordelattrr  r   setattrr  rG  r  r   r   )r!   r   
base_namesr   r   s        r"   rA  #_ClassBuilder._patch_original_class"  s     ii%%
 ((*95YF
 $,,^<* =< )  >>//1KDCu% 2
 &&7(%,
 ,
 ).C%++".
# =<s   3D
D	c                	   U R                   R                  5        VVs0 s H)  u  pU/ [        U R                  5      QSPSP7;  d  M'  X_M+     nnnU R                  (       d_  SUS'   U R
                  (       dI  U R                  R                   H/  nUR                  R                  SS5      (       d  M&  [        US'     O   0 nSnU R                  R                  SS  HY  nUR                  R                  SS5      b  S	nUR                  [        US
/ 5       Vs0 s H  nU[        XG5      _M     sn5        M[     [        U R                  5      nU R                  n	U R                   (       a-  S[        U R                  S
S5      ;  a  SU	;  a  U(       d  U	S-  n	UR                  5        VV
s0 s H(  u  pz[#        U
[$        5      (       d  M  XzR&                  _M*     nnn
/ nU(       a  [)        U R                  5      nUR                  5        H`  u  p~X4-  n	X7	 UR+                  U5        [,        R.                  " U5      R0                  nU[,        R2                  R4                  Ld  M\  XU'   Mb     UR                  S5      nUb  UR+                  U5        [7        UUU R                  5      US'   U	 Vs/ s H  owU;  d  M
  UPM     nnUR                  5        VVs0 s H  u  nnUU;   d  M  UU_M     nnnU Vs/ s H  owU;  d  M
  UPM     nnUR                  U5        U R8                  (       a  UR+                  [:        5        [        U5      US
'   U R                  R<                  US'   [?        U R                  5      " U R                  R@                  U R                  R                  U5      n[B        RD                  " UR                  RG                  5       U5       H  n[#        U[H        [J        45      (       a  [        URL                  SS5      nO:[#        U[N        5      (       a  [        URP                  SS5      nO[        USS5      nU(       d  My  U H,  n URR                  U R                  L nU(       a	  UUl)        M,  M.     M     U$ s  snnf s  snf s  sn
nf s  snf s  snnf s  snf ! [T         a     Md  f = f)z<
Build and return a new class with a `__slots__` attribute.
r   __weakref__FrG  r   r
   re   NT	__slots__r   )rQ  r   r+   __closure__)+r  r   rS   r   r  r  r   	__bases__r   r   r   r   r7  r   r   r  r  rQ   r   funcr   r   r  r  return_annotation	Parameteremptyr   r  _HASH_CACHE_FIELDr+   r:   r)   	itertoolschainvaluesclassmethodstaticmethod__func__rz   fgetcell_contentsrN   )r!   kvr   r   existing_slotsweakref_inheritedr   rN  namescached_propr   &additional_closure_functions_to_updateclass_annotationsrU  
annotationr   
slot_namesslotslot_descriptorreused_slotsr   itemclosure_cellscellmatchs                             r"   r@  !_ClassBuilder._create_slots_classF  sg    ,,.
.M% 0 01M:M}MM AD. 	 
 &&*/B&'++ $		 3 3H((,,-DeLL,8=) !4 !		))!B/H  $$]D9E$(!!! !(+r B B '(11 B 0 ))*
  WTYYR%HHU*%%%E &(XXZ
%/!+7 #D"""%/ 	 
 24. 0 ;/557
 H6==dC$..t4FF
W%6%6%<%<<.8d+ 8  "vvm4+6==>NO =!#3TYY!B} (-GutJ0Fdu
G *8)=)=)?
)?%oz! "D/!)? 	 

 (2Nzt5Mdz
N
		,/0
+;!YY33> 499odii00$))2E2ErJ OOLL!#I
D $l ;<< !(}d KD(++ !(		=$ G 'mT B %1 ..$));E
 -0*  &!
2 
K
>"
> H

 OJ " sS   &RRR
-RR4	R$R$R)-R);	R/R/!R44
SSc                   ^  [        T R                  U5      u  p#U 4S jnT R                  R                  X#U45        ST l        T $ )Nc                4   > TR                  US   5      U S'   g )Nr#   r   cls_dictr_   r!   s     r"   _attach_repr,_ClassBuilder.add_repr.<locals>._attach_repr  s    #'#;#;E*<M#NHZ r%   T)_make_repr_scriptr   r  r   r  )r!   nsr^   r_   ry  s   `    r"   add_repr_ClassBuilder.add_repr  sC    )$++r:	O 	$$f\%BCr%   c                    U R                   (       d  Sn[        U5      eS nU R                  U5      U R                  S'   U $ )Nz3__str__ can only be generated if a __repr__ exists.c                "    U R                  5       $ r5   r#   r    s    r"   __str__&_ClassBuilder.add_str.<locals>.__str__  s    ==?"r%   r  )r  rN   r   r  )r!   rX   r  s      r"   add_str_ClassBuilder.add_str  s?    GCS/!	# %)$<$<W$Ey!r%   c                v   ^^ [        S U R                   5       5      mU4S jnU R                  mUU4S jnX4$ )z6
Create custom __setstate__ and __getstate__ methods.
c              3  4   #    U  H  oS :w  d  M
  Uv   M     g7f)rQ  Nr   )r   ans     r"   r   8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>  s      !
)2=-@BB)s   		c                F   > T Vs0 s H  o[        X5      _M     sn$ s  snf !
Automatically created by attrs.
r   )r!   r   state_attr_namess     r"   slots_getstate=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate  s(     ;KK:J$'$--:JKKKs   c                   > [         R                  U 5      n[        U[        5      (       a  [	        TU5       H  u  p4U" X45        M     OT H  nX1;   d  M
  U" X1U   5        M     T(       a  U" [
        S5        gg)r  N)r   r   rQ   rS   ziprY  )r!   state_ClassBuilder__bound_setattrr   r   hash_caching_enabledr  s        r"   slots_setstate=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstate  ss     +2248O%'' $''7#?KD#D0 $@ -D}'Dk: - $ 148 $r%   )rS   r   r  )r!   r  r  r  r  s      @@r"   r!  %_ClassBuilder._make_getstate_setstate  sG    
 ! !
))!
 
	L  $//	9, --r%   c                $    S U R                   S'   U $ N__hash__)r  r    s    r"   make_unhashable_ClassBuilder.make_unhashable  s    %)z"r%   c                   ^  [        T R                  T R                  T R                  T R                  S9u  pSU 4S jjnT R
                  R                  XU45        T $ )Nr&  r)  c                4   > TR                  US   5      U S'   g r  rv  )rx  r`   r!   s     r"   attach_hash+_ClassBuilder.add_hash.<locals>.attach_hash  s    #'#;#;D<L#MHZ r%   )rx  r  r`   r  returnNone)_make_hash_scriptr   r   r  r  r  r   )r!   r^   r_   r  s   `   r"   add_hash_ClassBuilder.add_hash  sS    )IIKK<<''	
	N 	$$f[%ABr%   c                \  ^ ^ [        T R                  T R                  T R                  T R                  T R
                  T R                  T R                  T R                  T R                  T R                  T R                  SS9u  pmUU 4S jnT R                  R                  XU45        T $ )NF
attrs_initc                F   > US   nTUl         TR                  U5      U S'   g )Nr1  r   r   rx  r_   rB   r   r!   s      r"   _attach_init,_ClassBuilder.add_init.<locals>._attach_init2  s*    $D#.D #'#;#;D#AHZ r%   _make_init_scriptr   r   r  r  r  r  r  r  r   r	  r
  r  r   )r!   r^   r_   r  r   s   `   @r"   add_init_ClassBuilder.add_init"  s    %6IIKK##LLKKLL&
"{	B
 	$$f\%BCr%   c                D    U R                  S 5      U R                  S'   U $ )Nc                    [        U 40 UD6$ r5   )r   )r!   r   s     r"   r   +_ClassBuilder.add_replace.<locals>.<lambda>=  s    F4$;7$;r%   __replace__)r   r  r    s    r"   add_replace_ClassBuilder.add_replace;  s%    (,(@(@;)
}% r%   c                V    [        S U R                   5       5      U R                  S'   g )Nc              3     #    U  H7  nUR                   (       d  M  UR                  (       a  M)  UR                  v   M9     g 7fr5   )rB   rE   r   )r   fields     r"   r   /_ClassBuilder.add_match_args.<locals>.<genexpr>B  s0      1
$zz "'-- EJJ$s   AAA__match_args__)rS   r   r  r    s    r"   add_match_args_ClassBuilder.add_match_argsA  s'    +0 1
1
 ,
'(r%   c                \  ^ ^ [        T R                  T R                  T R                  T R                  T R
                  T R                  T R                  T R                  T R                  T R                  T R                  SS9u  pmUU 4S jnT R                  R                  XU45        T $ )NTr  c                F   > US   nTUl         TR                  U5      U S'   g )N__attrs_init__r  r  s      r"   _attach_attrs_init8_ClassBuilder.add_attrs_init.<locals>._attach_attrs_initX  s,    )*D#.D )-)A)A$)GH%&r%   r  )r!   r^   r_   r  r   s   `   @r"   add_attrs_init_ClassBuilder.add_attrs_initH  s    %6IIKK##LLKKLL&
"{	H
 	$$f5G%HIr%   c                   ^  T R                   n[        T R                  5      u  p#U 4S jnT R                  R	                  X#U45        [
        US'   T $ )Nc                4   > TR                  US   5      U S'   g )N__eq__rv  rw  s     r"   
_attach_eq(_ClassBuilder.add_eq.<locals>._attach_eqf  s    !%!9!9%/!JHXr%   __ne__)r  _make_eq_scriptr   r  r   r  )r!   r   r^   r_   r  s   `    r"   add_eq_ClassBuilder.add_eqa  sK    ^^'4	K 	$$fZ%@A8r%   c                   ^  T R                   nU 4S j[        T R                  T R                  5       5       u  US'   US'   US'   US'   T $ )Nc              3  F   >#    U  H  nTR                  U5      v   M     g 7fr5   rv  )r   methr!   s     r"   r   *_ClassBuilder.add_order.<locals>.<genexpr>r  s'      B
; $$T**;s   !__lt____le____gt____ge__)r  _make_orderr   r   )r!   r   s   ` r"   	add_order_ClassBuilder.add_ordero  sL    ^^B
#DIIt{{;B
>8blBxL"X,
 r%   c                  ^ 0 mU R                    HP  nUR                  =(       d    U R                  nU(       d  M+  U[        R                  Ld  M@  X4TUR
                  '   MR     T(       d  U $ U R                  (       a  Sn[        U5      eU4S jnSU R                  S'   U R                  U5      U R                  S'   SU l
        U $ )Nz7Can't combine custom __setattr__ with on_setattr hooks.c                d   >  TU   u  p4U" XU5      n[        XU5        g ! [          a    Un Nf = fr5   )KeyErrorr   )r!   r   valr   r;  nvalsa_attrss         r"   r   ._ClassBuilder.add_setattr.<locals>.__setattr__  sA    *"4. DS)T*  s     //TrG  r   )r   rJ   r
  r   NO_OPr   r  rN   r  r   r  )r!   r   rJ   rX   r   r  s        @r"   add_setattr_ClassBuilder.add_setattry  s    A9)9)9Jzj=#$=  
 K##KCS/!	+ 37./(,(@(@(M}%"&r%   c                    U R                   R                  Ul        U R                   R                   SUR                   3Ul        SU R                   R                   S3Ul        U$ )z0
Add __module__ and __qualname__ to a *method*.
r   $Method generated by attrs for class )r   r*   r+   r)   r-   r!   methods     r"   r$  (_ClassBuilder._add_method_dunders_unsafe  s`     !II00!%!7!7 8&//9JK 34993I3I2J!L 	 r%   c                   [         R                  " [        5         U R                  R                  Ul        SSS5        [         R                  " [        5         U R                  R
                   SUR                   3Ul        SSS5        [         R                  " [        5         SU R                  R
                   S3Ul        SSS5        U$ ! , (       d  f       N= f! , (       d  f       Nc= f! , (       d  f       U$ = f)z<
Add __module__ and __qualname__ to a *method* if possible.
Nr   r  )rI  rJ  rK  r   r*   r+   r)   r-   r  s     r"   r#  &_ClassBuilder._add_method_dunders_safe  s       0 $		 4 4F 1   0%)YY%;%;$<Afoo=N"OF 1   0CDIIDZDZC[[\]FN 1  10 10 10 s#   C+C!& C2
C!
C/2
DN)r   r:   )r  r  )r  r   r  r   )r)   r*   r+   r,   r-   rR  r1  r#   r<  rD  rA  r@  r}  r  r!  r  r  r  r  r  r  r  r  r  r$  r#  r0   r   r%   r"   r   r   m  s    I0iGiGV<'$0"HIV	'.R2
2@r%   r   c                    U b#  [        USLUSL45      (       a  Sn[        U5      eU b  X 4$ Uc  UnUc  UnUSL a  USL a  Sn[        U5      eX4$ )
Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
values of eq and order.  If *eq* is None, set it to *default_eq*.
N&Don't mix `cmp` with `eq' and `order`.FT-`order` can only be True if `eq` is True too.anyrN   )r@   rF   rH   
default_eqrX   s        r"   _determine_attrs_eq_orderr    sx    
 3$T0ABCC6o x 
z}	U{u}=o9r%   c                    U b#  [        USLUSL45      (       a  Sn[        U5      eS nU b  U" U 5      u  pXX4$ Uc  USpqO
U" U5      u  pUc  XpO
U" U5      u  p(USL a  USL a  Sn[        U5      eXX(4$ )r  Nr  c                8    [        U 5      (       a  SU pX4$ SnX4$ )z(
Decide whether a key function is used.
TN)rO   )r   r   s     r"   decide_callable_or_boolean>_determine_attrib_eq_order.<locals>.decide_callable_or_boolean  s-     E??u3 z Czr%   FTr  r  )	r@   rF   rH   r  rX   r  cmp_keyrG   rI   s	            r"   rL   rL     s    
 3$T0ABCC6o 1#6S)) 
zF/3
}y5e<	U{u}=ou''r%   c                h    USL d  USL a  U$ Uc  USL a  U$ U H  n[        X5      (       d  M    g   U$ )aX  
Check whether we should implement a set of methods for *cls*.

*flag* is the argument passed into @attr.s like 'init', *auto_detect* the
same as passed into @attr.s and *dunders* is a tuple of attribute names
whose presence signal that the user has implemented it themselves.

Return *default* if no reason for either for or against is found.
TF)r   )r   flagauto_detectdundersr=   dunders         r"   _determine_whether_to_implementr    sH     t|tu}|u, c**  Nr%   c                @  ^^^^^^^^	^
^^^^^^^^^^^^ Tb  SSK nUR                  [        S5      SS9  [        XOUS5      u  mmUb  Um[	        T[
        [        45      (       a  [        R                  " T6 mUUUUUUUUUUUUUUUUUUU
UU	4S jnU c  U$ U" U 5      $ )a  
A class decorator that adds :term:`dunder methods` according to the
specified attributes using `attr.ib` or the *these* argument.

Consider using `attrs.define` / `attrs.frozen` in new code (``attr.s`` will
*never* go away, though).

Args:
    repr_ns (str):
        When using nested classes, there was no way in Python 2 to
        automatically detect that.  This argument allows to set a custom
        name for a more meaningful ``repr`` output.  This argument is
        pointless in Python 3 and is therefore deprecated.

.. caution::
    Refer to `attrs.define` for the rest of the parameters, but note that they
    can have different defaults.

    Notably, leaving *on_setattr* as `None` will **not** add any hooks.

.. versionadded:: 16.0.0 *slots*
.. versionadded:: 16.1.0 *frozen*
.. versionadded:: 16.3.0 *str*
.. versionadded:: 16.3.0 Support for ``__attrs_post_init__``.
.. versionchanged:: 17.1.0
   *hash* supports `None` as value which is also the default now.
.. versionadded:: 17.3.0 *auto_attribs*
.. versionchanged:: 18.1.0
   If *these* is passed, no attributes are deleted from the class body.
.. versionchanged:: 18.1.0 If *these* is ordered, the order is retained.
.. versionadded:: 18.2.0 *weakref_slot*
.. deprecated:: 18.2.0
   ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now raise a
   `DeprecationWarning` if the classes compared are subclasses of
   each other. ``__eq`` and ``__ne__`` never tried to compared subclasses
   to each other.
.. versionchanged:: 19.2.0
   ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now do not consider
   subclasses comparable anymore.
.. versionadded:: 18.2.0 *kw_only*
.. versionadded:: 18.2.0 *cache_hash*
.. versionadded:: 19.1.0 *auto_exc*
.. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
.. versionadded:: 19.2.0 *eq* and *order*
.. versionadded:: 20.1.0 *auto_detect*
.. versionadded:: 20.1.0 *collect_by_mro*
.. versionadded:: 20.1.0 *getstate_setstate*
.. versionadded:: 20.1.0 *on_setattr*
.. versionadded:: 20.3.0 *field_transformer*
.. versionchanged:: 21.1.0
   ``init=False`` injects ``__attrs_init__``
.. versionchanged:: 21.1.0 Support for ``__attrs_pre_init__``
.. versionchanged:: 21.1.0 *cmp* undeprecated
.. versionadded:: 21.3.0 *match_args*
.. versionadded:: 22.2.0
   *unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
.. deprecated:: 24.1.0 *repr_ns*
.. versionchanged:: 24.1.0
   Instances are not compared as tuples of attributes anymore, but using a
   big ``and`` condition. This is faster and has more correct behavior for
   uncomparable values like `math.nan`.
.. versionadded:: 24.1.0
   If a class has an *inherited* classmethod called
   ``__attrs_init_subclass__``, it is executed after the class is created.
.. deprecated:: 24.1.0 *hash* is deprecated in favor of *unsafe_hash*.
Nr   zQThe `repr_ns` argument is deprecated and will be removed in or after August 2025.   )
stacklevelc                  > T=(       d    [        U 5      nT	SL =(       a    [        U [        5      nT=(       a    [        U S5      nU(       a  U(       a  Sn[	        U5      e[        U TTUT[        U TTSTS9TTT
UTTUT5      n[        U TTS5      (       a  UR                  T5        TSL a  UR                  5         [        U TTS5      nU(       d  USL a  UR                  5         U(       d#  [        U TTS5      (       a  UR                  5         T(       d  UR                  5         Tc  TSL a  [        U S	5      (       a  S
mTSLa  TS
La  Tb  Sn[        U5      eTS
L d  Tc  US
L d  U(       a  T
(       a  Sn[        U5      eOGTSL d  Tc  USL a  USL a  UR                  5         O$T
(       a  Sn[        U5      eUR                  5         [        U TTS5      (       a  UR                  5         O$UR!                  5         T
(       a  Sn[        U5      e["        (       a!  [        U S5      (       d  UR%                  5         [&        (       a(  T(       a!  [        U S5      (       d  UR)                  5         UR+                  5       $ )NTr   z/Can't freeze a class with a custom __setattr__.)r  r  )r=   r  )r  r  )r  r  r  r  r  Fr<   zlInvalid value for cache_hash.  To use hash caching, hashing must be either explicitly or implicitly enabled.r1  zFInvalid value for cache_hash.  To use hash caching, init must be True.r  r  )_has_frozen_base_class
issubclassr   r   rN   r   r  r}  r  r  r  r  rM   r  r  r  r  r   r  r   r  rD  )r   	is_frozenr*  has_own_setattrrX   builderrF   r   r  auto_excr)  r   eq_r   r&  r(  rA   rB   rE   
match_argsrJ   order_r?   repr_nsr%  r   r   r'  s          r"   wrapattrs.<locals>.wrap  s   94S9	T!Djm&D% 
*<+
 yCCS/!+!0 )
. +{M
 
 W%$;OO,k#7
 "*NN9&N
 
 ! Lt#"3
33DtE 1d6FJCC. 5=T\bEkf  En$  T\LR4ZI,=   En$##%*{M
 
 ""$^n$< 23 F F! L&s,<==""$""$$r%   )	warningswarnDeprecationWarningr  rQ   rR   rS   r   rT   )	maybe_clsr   r  r?   r@   rA   rB   r%  r&  r'  r   r   rE   r)  r
  rF   rH   r  r   r(  rJ   r   r  unsafe_hashr  r  r  r  s    ``` ``````````  ``````   @@r"   r   r     s    x c 	 	 	
 ,CUDAKC *tUm,,\\:.
j% j% j% j%\ 	?r%   c                &    U R                   [        L $ )zJ
Check whether *cls* has a frozen ancestor by looking at its
__setattr__.
)r   r   )r   s    r"   r  r    s    
 ??...r%   c           
     X    SU SU R                    S[        U SU R                  5       S3$ )z>
Create a "filename" suitable for a function being generated.
z<attrs generated  r   r+   rg   )r*   r   r)   )r   	func_names     r"   r   r   
  s7    
 I;a'7q35
6a	9r%   c                  ^^^	^
^^ [        S T 5       5      mSn[        [        U S5      5      m0 m	SnSm
SmU(       d  US-  nOUS-  nUS	-  nS
T
-   m
TS-  mU/mUUU	U
UU4S jnU(       a  TR                  US[         S3-   5        U(       a,  U" S[         S3US-  5        TR                  US-  S-   5        OU" S[         S3US-  5        TR                  US[         3-   5        O	U" SU5        SR                  T5      nUT	4$ )Nc              3     #    U  H5  oR                   S L d   UR                   b  M   UR                  S L d  M1  Uv   M7     g7f)TN)rA   rF   r   s     r"   r   $_make_hash_script.<locals>.<genexpr>  s/      aFFdNqvv!$$$,5s   ??	?        rA   zdef __hash__(selfzhash((z))z):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper()c           	     v  > TR                  X-   T-   UST	 S3-   /5        T H|  nUR                  (       aF  SUR                   S3nUR                  TU'   TR                  USU SUR                   S3-   5        MZ  TR                  USUR                   S3-   5        M~     TR                  US-   T-   5        g	)
z
Generate the code for actually computing the hash code.
Below this will either be returned directly or used to compute
a value which is then cached, depending on the value of cache_hash
r  ,r9  _key(self.z),        self.    N)r   rG   r   r   )
prefixindentr   cmp_namer   closing_bracesr_   	hash_funcmethod_lines	type_hashs
       r"   append_hash_computation_lines8_make_hash_script.<locals>.append_hash_computation_lines/  s     	)+8I;a00	
 Axxqvvhd+"#((h##xzxrBB ##F}QVVHA-F$FG  	FVOn<=r%   zif self.z	 is None:zobject.__setattr__(self, '', r  self. = zreturn self.zreturn r   )rS   rA   r   r   rY  r   )r   r   r&  r)  tabhash_defr,  r^   r(  r_   r)  r*  r+  s    `      @@@@@r"   r  r    sF      E C.sF;<IE"HINDEYY%	1	#:L> >4 CH->,?y"IIJ),->,?sCS1W a#.))*#.a 	CL1B0C"DDE%i5YY|$F5=r%   c                \    [        XSSS9u  p#[        X#[        U S5      S9  US   U l        U $ )z
Add a hash method to *cls*.
Fr  r  ra   )r  rc   r   r  r   r   r^   r_   s       r"   	_add_hashr6  \  sA     &5UMF  9#z J $CLJr%   c                P    U R                  U5      nU[        L a  [        $ U(       + $ )zR
Check equality and either forward a NotImplemented or
return the result negated.
)r  NotImplemented)r!   otherresults      r"   r  r  j  s(    
 [[F:r%   c                R   U  Vs/ s H  oR                   (       d  M  UPM     n n/ SQn0 nU (       a  UR                  S5        U  H  nUR                  (       aQ  SUR                   S3nUR                  X4'   UR                  SU SUR                   SU SUR                   S	3	5        O+UR                  S
UR                   SUR                   35        XS   Ld  M  US    S3US'   M     UR                  S5        OUR                  S5        SR	                  U5      nXS4$ s  snf )z.
Create __eq__ method for *cls* with *attrs*.
)zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz    return  (r9  r!  r  r"  z) == z(other.r  r#  z
 == other.re   z andz    )z    return Truer   )rF   r   rG   r   r   )r   r   r   r_   r'  r^   s         r"   r  r  v  s    &1QE&E E_%Axxqvvhd+ #$((xjqvvheH:WQVVHTUV }QVVHJqvvhGHb	!$Ryk.b	  	W&'YYuF== 's
   D$D$c                   ^^ T Vs/ s H  o"R                   (       d  M  UPM     snmU4S jmU4S jnU4S jnU4S jnU4S jnX4XV4$ s  snf )z1
Create ordering methods for *cls* with *attrs*.
c                >   >^  [        S U 4S jT 5        5       5      $ )z
Save us some typing.
c              3  H   #    U  H  u  pU(       a  U" U5      OUv   M     g 7fr5   r   )r   r   r   s      r"   r   6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>  s(      

 CJ5(    "c              3  h   >#    U  H'  n[        TUR                  5      UR                  4v   M)     g 7fr5   )r   r   rI   )r   r   objs     r"   r   r?    s(      =Baff%q{{3Us   /2)rS   )rB  r   s   `r"   attrs_to_tuple#_make_order.<locals>.attrs_to_tuple  s)      
=B
 
 	
r%   c                d   > UR                   U R                   L a  T" U 5      T" U5      :  $ [        $ r  r   r8  r!   r9  rC  s     r"   r  _make_order.<locals>.__lt__  0     ??dnn,!$'.*???r%   c                d   > UR                   U R                   L a  T" U 5      T" U5      :*  $ [        $ r  rF  rG  s     r"   r  _make_order.<locals>.__le__  0     ??dnn,!$'>%+@@@r%   c                d   > UR                   U R                   L a  T" U 5      T" U5      :  $ [        $ r  rF  rG  s     r"   r  _make_order.<locals>.__gt__  rI  r%   c                d   > UR                   U R                   L a  T" U 5      T" U5      :  $ [        $ r  rF  rG  s     r"   r  _make_order.<locals>.__ge__  rL  r%   )rH   )r   r   r   r  r  r  r  rC  s    `     @r"   r  r    sI     )1Q)E	
 6))c *s
   A
A
c                    Uc  U R                   n[        U5      u  p#[        X#[        U S5      S9  US   U l        [
        U l        U $ )z-
Add equality methods to *cls* with *attrs*.
r  r4  )r   r  rc   r   r  r  r5  s       r"   _add_eqrR    sN     }###E*MF 9#x H xCJCJJr%   c                   [        S U  5       5      nU VVVs0 s H  u  p4oT[        :w  d  M  US-   U_M     nnnn[        US'   [        US'   [        US'   / nU HM  u  p4nU(       a  SU-   OSU-   S-   n	U[        :X  a
  U< S	U	< S
3OU< S	U< SU	< S3n
UR                  U
5        MO     SR                  U5      nUc  SnOUS-   nSSSSSSSSSSSSSU SU S3SS/nS R                  U5      U4$ s  snnnf )!z;
Create the source and globs for a __repr__ and return it.
c              3     #    U  HN  nUR                   S Ld  M  UR                  UR                   SL a  [         OUR                   UR                  4v   MP     g7f)FTN)r?   r   rB   r   s     r"   r   $_make_repr_script.<locals>.<genexpr>  sD      "A66 	?!&&D.$affqvv>s
   A?A_reprr   rK  r   r/  zgetattr(self, "z", NOTHING)z={z!r}z_repr(z)}r   z1{self.__class__.__qualname__.rsplit(">.", 1)[-1]}z.{self.__class__.__name__}zdef __repr__(self):z  try:z:    already_repring = _compat.repr_context.already_repringz  except AttributeError:z!    already_repring = {id(self),}z:    _compat.repr_context.already_repring = already_repringz  else:z#    if id(self) in already_repring:z      return '...'z	    else:z#      already_repring.add(id(self))z    return f'(z)'z
  finally:z$    already_repring.remove(id(self))r   )rS   r?   r   rK  r   r   r   )r   r|  attr_names_with_reprsr   rr9  r_   attribute_fragmentsrv   accessorfragmentrepr_fragmentcls_name_fragmentr   s                 r"   r{  r{    s]    " ""  -B,Ajdq$Yw,A 
  E),E
E)+
GdN%6%=%M 	
 Dy  *'+T8< 	
 	""8, , II12M	zO!== 	D"+D--
)*!M?"=.E$ 99UU""Us
   C2
C2c                z    Uc  U R                   n[        X!5      u  p4[        X4[        U S5      S9  US   U l        U $ )z
Add a repr method to *cls*.
r#   r4  )r   r{  rc   r   r#   )r   r|  r   r^   r_   s        r"   	_add_reprr`    sH     }##%e0MF 9#z J $CLJr%   c                    [        U 5      nUc"  [        U [        5      (       d  Sn[        U5      e[	        U SS5      nUc,  Ub  [	        USS5      nUb  X0l        U$ U < S3n[        U5      eU$ )a  
Return the tuple of *attrs* attributes for a class.

The tuple also allows accessing the fields by their names (see below for
examples).

Args:
    cls (type): Class to introspect.

Raises:
    TypeError: If *cls* is not a class.

    attrs.exceptions.NotAnAttrsClassError:
        If *cls* is not an *attrs* class.

Returns:
    tuple (with name accessors) of `attrs.Attribute`

.. versionchanged:: 16.2.0 Returned tuple allows accessing the fields
   by name.
.. versionchanged:: 23.1.0 Add support for generic classes.
NPassed object must be a class.r   ! is not an attrs-decorated class.)r   rQ   r:   rM   r   r   r   )r   generic_baserX   r   s       r"   r   r   ,  s    . $C(LJsD$9$9.nC*D1E}#L*;TBE  ',#89"3''Lr%   c                    [        U [        5      (       d  Sn[        U5      e[        U SS5      nUc  U < S3n[	        U5      eU Vs0 s H  o3R
                  U_M     sn$ s  snf )a  
Return an ordered dictionary of *attrs* attributes for a class, whose keys
are the attribute names.

Args:
    cls (type): Class to introspect.

Raises:
    TypeError: If *cls* is not a class.

    attrs.exceptions.NotAnAttrsClassError:
        If *cls* is not an *attrs* class.

Returns:
    dict[str, attrs.Attribute]: Dict of attribute name to definition

.. versionadded:: 18.1.0
rb  r   Nrc  )rQ   r:   rM   r   r   r   )r   rX   r   r   s       r"   fields_dictrf  Z  sj    & c4  .nC*D1E}89"3''$%u!FFAIu%%%s   A!c           	         [         R                  SL a  g[        U R                  5       H0  nUR                  nUc  M  U" X[        XR                  5      5        M2     g)z
Validate all attributes on *inst* that have a validator.

Leaves all exceptions through.

Args:
    inst: Instance of a class with *attrs* attributes.
FN)r   _run_validatorsr   r   r>   r   r   )r   r   rc  s      r"   r  r  w  sI     %'DNN#KK=dwtVV,- $r%   c                T    UR                  U 5      nU=(       a    SUR                  ;   $ )z6
Check if the attribute name comes from a slot class.
rR  )r   r   )a_namer   r   s      r"   _is_slot_attrrk    s(     

F
#C.;#,,..r%   c                $   U
S L=(       a    U
[         R                  LnU(       a  U(       a  Sn[        U5      eU=(       d    Un/ n0 nU H  nUR                  (       d  UR                  [
        L a  M)  UR                  U5        UUUR                  '   UR                  b  USL a  Sn[        U5      eSnMl  U(       d  Mu  UR                  [         R                  Ld  M  SnM     [        UUUUUUUUU	UUU(       a  SOS5      u  nnnU R                  [        R                  ;   a6  UR                  [        R                  U R                     R                  5        UR                  [
        US.5        U(       a  [        R                   US'   UUU4$ )Nz$Frozen classes can't use on_setattr.Tr  r1  )r   	attr_dictr   )r   r  rN   rB   r=   r   r   r   rJ   _attrs_to_init_scriptr*   sysmodulesr7  r   r   r   )r   r   pre_initpre_init_has_args	post_initr&  r%  r)  r   r*  cls_on_setattrr  has_cls_on_setattrrX   needs_cached_setattrfiltered_attrsrm  r   r^   r_   r   s                        r"   r  r    sh    	d"J~W]]'J  $4o%/NIvv!))w.a 	!&&<<#~< o%#' ALL$E#'    "7&J"FE; ~~$S[[099:	LLW9=> (4';';#$5+%%r%   c                    SU  SU S3$ )zB
Use the cached object.setattr to set *attr_name* to *value_var*.

_setattr('r.  r  r   )r   	value_varhas_on_setattrs      r"   _setattrr|    s     	{#i[22r%   	Converterc                2    SU  SUR                  X5       S3$ )z_
Use the cached object.setattr to set *attr_name* to *value_var*, but run
its converter first.
ry  r.  r  )_fmt_converter_callr   rz  r{  rC   s       r"   _setattr_with_converterr    s&     	{#i&C&CI&Y%ZZ[\\r%   c                8    U(       a  [        XS5      $ SU  SU 3$ )zc
Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
relegate to _setattr.
Tr/  r0  )r|  )r   r   r{  s      r"   _assignr    s'    
 	$//9+S((r%   c                X    U(       a  [        XSU5      $ SU  SUR                  X5       3$ )z
Unless *attr_name* has an on_setattr hook, use normal assignment after
conversion. Otherwise relegate to _setattr_with_converter.
Tr/  r0  )r  r  r  s       r"   _assign_with_converterr    s5     &yT9MM9+S!>!>y!T UVVr%   c                   ^ U SL a9  USL a  S[         [        4$         SU4S jjn          SU4S jjnSUU4$ S[        [        4$ )z[
Determine the correct setter functions based on whether a class is frozen
and/or slotted.
Tr   c                N   > [        U T5      (       a  [        XU5      $ SU  SU 3$ N_inst_dict['z'] = )rk  r|  )r   rz  r{  r   s      r"   
fmt_setter&_determine_setters.<locals>.fmt_setter  s2     Y66	nEE!)E)==r%   c                z   > U(       d  [        U T5      (       a  [        XX#5      $ SU  SUR                  X5       3$ r  )rk  r  r  )r   rz  r{  rC   r   s       r"   fmt_setter_with_converter5_determine_setters.<locals>.fmt_setter_with_converter  sH     y-!H!H..  ")E)2O2OPY2e1fggr%   )z_inst_dict = self.__dict__r   r   rz  r   r{  r  r  r   
r   r   rz  r   r{  r  rC   r}  r  r   )r|  r  r  r  )r&  r%  r   r  r  s     `  r"   _determine_settersr    s     ~D=x!888	>	>'*	><@	>	>	h	h	h !	h !		h
 	h ,%
 	
 w...r%   c           
        U(       a  S/O/ nU	(       a  UR                  S5        [        XU5      u  pnUR                  U5        / n/ n/ n0 nSS0nU  GH!  nUR                  (       a  UR                  U5        UR                  nUR
                  SL=(       d%    UR
                  [        R                  L=(       a    U
nUR                  n[        UR                  [        5      nU(       a  UR                  R                  (       a  SOSnUR                  b5  [        UR                  [        5      (       d  [        UR                  5      nOUR                  nUR                  SL Ga  U(       a  [         UR                  4-  nUbJ  UR                  U" UUSU S	3-   UU5      5        UR                  UUR#                  UR                  5      '   O UR                  U" UUSU S	3-   U5      5        UR                  R$                  UU'   GOUbH  UR                  U" US
U S3UU5      5        UR                  UUR#                  UR                  5      '   GOUR                  U" US
U S3U5      5        GOUR                  [&        La  U(       d  U SU S3nUR(                  (       a  UR                  U5        OUR                  U5        UbD  UR                  U" UUUU5      5        UR                  UUR#                  UR                  5      '   GOUR                  U" UUU5      5        GOU(       GaN  U S3nUR(                  (       a  UR                  U5        OUR                  U5        UR                  SU S35        [         UR                  4-  nUb}  UR                  SU" UUUU5      -   5        UR                  S5        UR                  SU" UUS-   U-   S	-   UU5      -   5        UR                  UUR#                  UR                  5      '   ORUR                  SU" UUU5      -   5        UR                  S5        UR                  SU" UUS-   U-   S	-   U5      -   5        UR                  R$                  UU'   OUR(                  (       a  UR                  U5        OUR                  U5        UbC  UR                  U" UUUU5      5        UR                  UUR#                  UR                  5      '   OUR                  U" UUU5      5        UR                  SL d  GM  UR*                  b  Uc  UR*                  UU'   GM  Uc  GM  UR,                  (       d  GM  UR,                  UU'   GM$     U(       az  [.        US'   UR                  S5        U HZ  nSUR                  -   nSUR                  -   nUR                  SU SU SUR                   S	35        UR                  UU'   UUU'   M\     U(       a  UR                  S5        U(       a?  U(       a  U(       a  S[0         S3nOS[0         S3nO
S[0         S3nUR                  U5        U(       a-  S R3                  S! U  5       5      n UR                  S"U  S	35        S#R3                  U5      nUn!U(       ac  UU(       a  S#OS S$S#R3                  U5       3-  nS#R3                  S% U 5        V"s/ s H
  n"U" S&U" 3PM     sn"5      n#U!U!(       a  S#OS-  n!U!U#-  n!U(       a  U(       a	  S'U! S	3US('   S)n$S*U SU S+U(       a  U$R3                  U5      OS, S-3UU4$ s  sn"f ).z
Return a script of an initializer for *attrs*, a dict of globals, and
annotations for the initializer.

The globals are required by the generated script.
zself.__attrs_pre_init__()z$_setattr = _cached_setattr_get(self)r  Nr!    FrW  r  zattr_dict['z
'].defaultz=attr_dict['z=NOTHINGzif z is not NOTHING:r$  zelse:Tr   z#if _config._run_validators is True:__attr_validator___attr_z(self, z, self.zself.__attrs_post_init__()ry  z', None)r  z	'] = Noner/  z = Noner   c              3  d   #    U  H&  oR                   (       d  M  S UR                   3v   M(     g7f)r/  N)rB   r   r   s     r"   r   (_attrs_to_init_script.<locals>.<genexpr>	  s"     B%Q66(%x(%s   00zBaseException.__init__(self, r   z*, c              3  H   #    U  H  oR                  S 5      S   v   M     g7f)=r   N)split)r   kwas     r"   r   r  	  s     #N#IIcN1$5r@  r  zself.__attrs_pre_init__(r   z
    zdef z):
    passr   )r   r  r   r>   r   rJ   r   r  rK   rQ   r=   rP   
takes_selfrC   r}  rB   _INIT_FACTORY_PAT_get_global_namerW   r   rE   r:   _first_param_typer   rY  r   )%r   r  
is_slottedcall_pre_initrr  call_post_initdoes_cache_hashr   r*  rv  ru  method_namer   extra_linesr  r  r   kw_only_argsattrs_to_validatenames_for_globalsr   r   r   r{  arg_namehas_factory
maybe_selfrC   init_factory_nameargval_nameinit_hash_cachevalspre_init_argskw_arg_namepre_init_kw_only_argsNLs%                                        r"   rn  rn  .  s*   ( .;()E 3		
 :L}:6K6 
LLDL T"K;;$$Q'FF	T1 
LL-D2D 	
 77 G4*qyy/C/CV
;;":akk9+M+M!!++.II66U?$5	$A!(LL1%-!J<q0AA*%	 "++ &i&@&@&HI LL"%-!J<q0AA* 89yy7H7H!"34&-!%i[
;&!	 '' ")"<"<QVV"DE !%i[
;& YYg%kJl9+Z@Cyy##C(C $-!8^Y '' ")"<"<QVV"DE Z	8^LMJh'Cyy##C(C LL3xj(89: 1QVVI =$/!8^Y W%/!)C/*<sB&!	 '' ")"<"<QVV"DE Z	8^LL W% !)C/*<sB& 45993D3D/0yy##H-H%$-!8^Y '' ")"<"<QVV"DE Z	8^LM66T>vv!i&7()H%&9+F+F+F(1(C(CH%k n '.)$:;"A*QVV3H!AFF*ILL4z7166(!LM*+++h'+,i( # 12 $./@.A"J$01B0C9"M %&7%8@O_% xxB%BB4TF!<=99T?DM44R(DIIl,C+DEE $		 $O#N $OK -q.#N!
 	B6..*-m_A>a 
BWTF +RWWU^&) *	 	 s   ]	c                $    U R                  S5      $ )z
The default __init__ parameter name for a field.

This performs private-name adjustment via leading-unscore stripping,
and is the default value of Attribute.alias if not provided.
r9  )lstripr  s    r"   r   r   2	  s     ;;sr%   c                  p    \ rS rSrSrSr          SS jrS r\SSS jj5       r	S r
S	 rS
 rS rSrg)r   i=	  a6  
*Read-only* representation of an attribute.

.. warning::

   You should never instantiate this class yourself.

The class has *all* arguments of `attr.ib` (except for ``factory`` which is
only syntactic sugar for ``default=Factory(...)`` plus the following:

- ``name`` (`str`): The name of the attribute.
- ``alias`` (`str`): The __init__ parameter name of the attribute, after
  any explicit overrides and default private-attribute-name handling.
- ``inherited`` (`bool`): Whether or not that attribute has been inherited
  from a base class.
- ``eq_key`` and ``order_key`` (`typing.Callable` or `None`): The
  callables that are used for comparing and ordering objects by this
  attribute, respectively. These are set by passing a callable to
  `attr.ib`'s ``eq``, ``order``, or ``cmp`` arguments. See also
  :ref:`comparison customization <custom-comparison>`.

Instances of this class are frequently used for introspection purposes
like:

- `fields` returns a tuple of them.
- Validators get them passed as the first argument.
- The :ref:`field transformer <transform-fields>` hook receives a list of
  them.
- The ``alias`` property exposes the __init__ parameter name of the field,
  with any overrides and default private-attribute handling applied.


.. versionadded:: 20.1.0 *inherited*
.. versionadded:: 20.1.0 *on_setattr*
.. versionchanged:: 20.2.0 *inherited* is not taken into account for
    equality checks and hashing anymore.
.. versionadded:: 21.1.0 *eq_key* and *order_key*
.. versionadded:: 22.2.0 *alias*

For the full version history of the fields, see `attr.ib`.
)r   r=   r>   r?   rF   rG   rH   rI   rA   rB   rD   r:   rC   rE   r   rJ   rK   Nc                   [        X^=(       d    UU=(       d    US5      u  pnn[        R                  U 5      nU" SU5        U" SU5        U" SU5        U" SU5        U" SU5        U" SU5        U" SU5        U" S	U5        U" S
U5        U" SU5        U" SU5        U" SU	(       a  [        R                  " [        U	5      5      O[        5        U" SU
5        U" SU5        U" SU5        U" SU5        U" SU5        g )NTr   r=   r>   r?   rF   rG   rH   rI   rA   rB   rC   rD   r:   rE   r   rJ   rK   )rL   r   r   typesMappingProxyTyper  _EMPTY_METADATA_SINGLETON)r!   r   r=   r>   r?   r@   rA   rB   r   rD   r:   rC   rE   rF   rG   rH   rI   rJ   rK   bound_setattrs                       r"   r1  Attribute.__init__~	  s   * (B2y1E4(
$E9
 %,,T2 	fd#i)k9-fd#dBh'gu%k9-fd#fd#k9-  &&tH~6.	
 	fd#i)k9-lJ/gu%r%   c                    [         er5   )r   r   s      r"   r   Attribute.__setattr__	  s    !!r%   c                   Uc  UR                   nOUR                   b  SU S3n[        U5      eU " UUR                  UR                  UR                  S UR
                  UR                  SUR                  UUR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  5      $ )Nz>Type annotation and type argument cannot both be present for 'z'.F)r:   rN   _default
_validatorr?   rA   rB   rD   rC   rE   rF   rG   rH   rI   rJ   rK   )r   r   r   r:   rX   s        r"   r   Attribute.from_counting_attr	  s     <77DWW RSWRXXZ[CS/!KKMMGGGGGGKKLLJJEEIIHHLLMMHH%
 	
r%   c                p    [         R                   " U 5      nUR                  UR                  5       5        U$ )z
Copy *self* and apply *changes*.

This works similarly to `attrs.evolve` but that function does not work
with :class:`attrs.Attribute`.

It is mainly meant to be used for `transform-fields`.

.. versionadded:: 20.3.0
)copy	_setattrsr   )r!   r   news      r"   r   Attribute.evolve	  s(     iiogmmo&
r%   c                B   ^  [        U 4S jT R                   5       5      $ )
Play nice with pickle.
c              3  r   >#    U  H,  nUS :w  a  [        TU5      O[        TR                  5      v   M.     g7f)rD   N)r   r  rD   r   r   r!   s     r"   r   )Attribute.__getstate__.<locals>.<genexpr>	  s4      
& $(:#5GD$4;NN&s   47rS   rR  r    s   `r"   r  Attribute.__getstate__	  s#      

 
 	
r%   c                N    U R                  [        U R                  U5      5        gr  N)r  r  rR  r!   r  s     r"   r  Attribute.__setstate__	  s     	s4>>512r%   c           	         [         R                  U 5      nU HH  u  p4US:w  a
  U" X45        M  U" UU(       a  [        R                  " [	        U5      5      O[
        5        MJ     g )NrD   )r   r   r  r  r  r  )r!   name_values_pairsr  r   r   s        r"   r  Attribute._setattrs	  sU    $,,T2,KDz!d* ! ..tE{;6	 -r%   r   )
NNNFNNNNNNr5   )r   r   r   rV   )r)   r*   r+   r,   r-   rR  r1  r   r]  r   r   r  r  r  r0   r   r%   r"   r   r   =	  sb    (XI< '5&n" 
 
:$
3r%   r   rD   )r   r=   r>   r?   r@   rF   rH   rA   rB   r   rK   )r   r   c                  ~    \ rS rSrSrSr/ \" S S 5       5      Q\" SSSSSSS	SS	SSS	SS	SS
9P7rSr	S r
S rS rSrg)rV   i!
  a  
Intermediate representation of attributes that uses a counter to preserve
the order in which the attributes have been defined.

*Internal* data structure of the attrs library.  Running into is most
likely the result of a bug like a forgotten `@attr.s` decorator.
)r  r  rK   rC   r   rF   rG   rA   rB   rE   rD   rJ   rH   rI   r?   r:   c              #  j   #    U  H)  n[        U[        U5      [        S SS SSSSS SS SS S9v   M+     g 7f)NTFr   rK   r=   r>   r?   r@   rA   rB   rE   rF   rG   rH   rI   r   rJ   )r   r   r   )r   r   s     r"   r   _CountingAttr.<genexpr>=
  sR      
$
# -d3"
s   13)	r   r  r?   rF   rH   rA   rB   rJ   rK   rD   NTFr  r   c                   [         =R                  S-  sl        [         R                  U l        Xl        X l        Xpl        X0l        Xl        Xl        Xl	        Xl
        XPl        X`l        Xl        Xl        Xl        Xl        UU l        g r   )rV   cls_counterr   r  r  rC   r?   rF   rG   rH   rI   rA   rB   rD   r:   rE   rJ   rK   )r!   r=   r>   r?   r@   rA   rB   rC   rD   r:   rE   rF   rG   rH   rI   rJ   rK   s                    r"   r1  _CountingAttr.__init__o
  so    & 	!!Q&!$00#"	
"		 	$
r%   c                f    U R                   c  Xl         U$ [        U R                   U5      U l         U$ )zl
Decorator that adds *meth* to the list of validators.

Returns *meth* unchanged.

.. versionadded:: 17.1.0
)r  rU   r!   r  s     r"   r>   _CountingAttr.validator
  s3     ??""O  #4??D9DOr%   c                V    U R                   [        La  [        e[        USS9U l         U$ )z
Decorator that allows to set the default for an attribute.

Returns *meth* unchanged.

Raises:
    DefaultAlreadySetError: If default has been set before.

.. versionadded:: 17.1.0
T)r  )r  r   r   rP   r  s     r"   r=   _CountingAttr.default
  s)     =='((6r%   )r)   r*   r+   r,   r-   rR  rS   r   r   r  r1  r>   r=   r0   r   r%   r"   rV   rV   !
  s    I$0	 
$
%
 

0> 		
?0Ob K#Jr%   rV   c                  2    \ rS rSrSrSrSS jrS rS rSr	g)	rP   i
  a  
Stores a factory callable.

If passed as the default value to `attrs.field`, the factory is used to
generate a new value.

Args:
    factory (typing.Callable):
        A callable that takes either none or exactly one mandatory
        positional argument depending on *takes_self*.

    takes_self (bool):
        Pass the partially initialized instance that is being initialized
        as a positional argument.

.. versionadded:: 17.1.0  *takes_self*
rW   r  c                    Xl         X l        g r5   r  )r!   rW   r  s      r"   r1  Factory.__init__
  s    $r%   c                B   ^  [        U 4S jT R                   5       5      $ )r  c              3  <   >#    U  H  n[        TU5      v   M     g 7fr5   r  r  s     r"   r   'Factory.__getstate__.<locals>.<genexpr>
  s     D^TWT4((^s   r  r    s   `r"   r  Factory.__getstate__
  s     DT^^DDDr%   c                Z    [        U R                  U5       H  u  p#[        XU5        M     gr  )r  rR  rM  )r!   r  r   r   s       r"   r  Factory.__setstate__
  s%     t~~u5KDD& 6r%   N)F)
r)   r*   r+   r,   r-   rR  r1  r  r  r0   r   r%   r"   rP   rP   
  s    $ *I%E'r%   rP   )
r   r=   r>   r?   r@   rF   rH   rA   rB   r   c                  V    \ rS rSrSrSrSSS.S jr\SS j5       rSS jr	S	 r
S
 rSrg)r}  i
  a1  
Stores a converter callable.

Allows for the wrapped converter to take additional arguments. The
arguments are passed in the order they are documented.

Args:
    converter (Callable): A callable that converts the passed value.

    takes_self (bool):
        Pass the partially initialized instance that is being initialized
        as a positional argument. (default: `False`)

    takes_field (bool):
        Pass the field definition (an :class:`Attribute`) into the
        converter as a positional argument. (default: `False`)

.. versionadded:: 24.1.0
)__call__r  _global_namerC   takes_fieldr  Fr  r  c                 ^  UT l         UT l        UT l        [        U5      nUR	                  5       T l        T R                  (       d  T R                  (       d  U 4S jT l        OgT R                  (       a  T R                  (       d  U 4S jT l        O9T R                  (       d  T R                  (       a  U 4S jT l        OU 4S jT l        UR                  5       nUb  UT R                  R                  S'   g g )Nc                &   > TR                  U 5      $ r5   rC   )r   r9  __r!   s      r"   r   $Converter.__init__.<locals>.<lambda>  s    1Fr%   c                &   > TR                  X5      $ r5   r  )r   instancer  r!   s      r"   r   r    s    9r%   c                &   > TR                  X5      $ r5   r  )r   r  r  r!   s      r"   r   r    s    T^^6r%   c                (   > TR                  XU5      $ r5   r  )r   r  r  r!   s      r"   r   r  #  s    4>><r%   r  )	rC   r  r  r   get_first_param_typer  r  get_return_typer   )r!   rC   r  r  exrts   `     r"   r1  Converter.__init__  s    "$&!),!#!8!8!:4#3#3FDM__T%5%5DM T%5%5DMDM !>68DMM))(3 r%   c                    SU  3$ )zP
Return the name that a converter for an attribute name *attr_name*
would have.
__attr_converter_r   )r   s    r"   r  Converter._get_global_name+  s     #9+..r%   c                p   U R                   (       d(  U R                  (       d  U R                  U5       SU S3$ U R                   (       a+  U R                  (       a  U R                  U5       SU SU S3$ U R                   (       a  U R                  U5       SU S3$ U R                  U5       SU SU S3$ )z
Return a string that calls the converter for an attribute name
*attr_name* and the value in variable named *value_var* according to
`self.takes_self` and `self.takes_field`.
rW  r  z, self, attr_dict['z'])z, self)z, attr_dict[')r  r  r  )r!   r   rz  s      r"   r  Converter._fmt_converter_call3  s     4#3#3++I67q1EE??t//++I67qCVW`Vaadee??++I67q7KK''	231YK}YKWZ[[r%   c                J    U R                   U R                  U R                  S.$ )z`
Return a dict containing only converter and takes_self -- the rest gets
computed when loading.
rC   r  r  r  r    s    r"   r  Converter.__getstate__D  s%     //++
 	
r%   c                (    U R                   " S0 UD6  g)z
Load instance from state.
Nr   r  r  s     r"   r  Converter.__setstate__O  s     	r%   )r  r  rC   r  r  N)r   r   r  r   )r   r   rz  r   r  r   )r)   r*   r+   r,   r-   rR  r1  r^  r  r  r  r  r0   r   r%   r"   r}  r}  
  s>    (I 165 96 / /\"	
r%   r  c                  ^ [         R                  " SU 5      n [        U[        5      (       a  UnOC[        U[        [
        45      (       a  U Vs0 s H  of[        5       _M     nnOSn[        U5      eUR                  SS5      nUR                  SS5      n	UR                  SS5      n
0 mUb  TR                  U5        Ub  UTS'   U	b  U	TS'   U
b  U
TS'   [        R                  " X0 U4S j5      n[        R                  " [        [        5         [         R"                  " S5      R$                  R'                  S	S
5      Ul        SSS5        UR                  SS5      n[+        UUR'                  S5      UR'                  S5      S5      u  US'   US'   [-        SSU0UD6" U5      nUR/                  5        VVs0 s H   u  pUR0                  c  M  XR0                  _M"     snnUl        U$ s  snf ! , (       d  f       N= fs  snnf )a  
A quick way to create a new class called *name* with *attrs*.

.. note::

    ``make_class()`` is a thin wrapper around `attr.s`, not `attrs.define`
    which means that it doesn't come with some of the improved defaults.

    For example, if you want the same ``on_setattr`` behavior as in
    `attrs.define`, you have to pass the hooks yourself: ``make_class(...,
    on_setattr=setters.pipe(setters.convert, setters.validate)``

.. warning::

    It is *your* duty to ensure that the class name and the attribute names
    are valid identifiers. ``make_class()`` will *not* validate them for
    you.

Args:
    name (str): The name for the new class.

    attrs (list | dict):
        A list of names or a dictionary of mappings of names to `attr.ib`\
        s / `attrs.field`\ s.

        The order is deduced from the order of the names or attributes
        inside *attrs*.  Otherwise the order of the definition of the
        attributes is used.

    bases (tuple[type, ...]): Classes that the new class will subclass.

    class_body (dict):
        An optional dictionary of class attributes for the new class.

    attributes_arguments: Passed unmodified to `attr.s`.

Returns:
    type: A new class with *attrs*.

.. versionadded:: 17.1.0 *bases*
.. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained.
.. versionchanged:: 23.2.0 *class_body*
.. versionchanged:: 25.2.0 Class names can now be unicode.
NFKCz(attrs argument must be a dict or a list.r  Nr  r1  c                &   > U R                  T5      $ r5   )r7  )r|  r~   s    r"   r   make_class.<locals>.<lambda>  s    		$r%   r
   r)   __main__r@   rF   rH   Tr   r   )unicodedata	normalizerQ   r  rR   rS   rY   rM   popr7  r  	new_classrI  rJ  rK  rN   ro  	_getframe	f_globalsr   r*   r  r   r   r:   r   )r   r   bases
class_bodyattributes_argumentsrx  r   rX   rq  rs  	user_inittype_r@   r   rb  rc  r~   s                   @r"   
make_classr  k  s   `   .D%	ED%=	)	))./AvxK/8n||0$7H2D9IZ.IDJ%-!"&/"#$ZOOD-GHE 
		^Z	8==+5599

 
9 
"
"5$
/C 	"  &  )		T"W% 
8x
8#7
8
?C 'nn..da!&&	66	.C J_ 02 
9	8&s   G06G5>HH5
H)r%  r  c                  ,    \ rS rSrSr\" 5       rS rSrg)_AndValidatori  z*
Compose many validators to a single one.
c                <    U R                    H  nU" XU5        M     g r5   )_validators)r!   r   r   r   rc  s        r"   r  _AndValidator.__call__  s    !!Ad%  "r%   r   N)	r)   r*   r+   r,   r-   rY   r  r  r0   r   r%   r"   r  r    s     (K!r%   r  c                     / nU  H6  nUR                  [        U[        5      (       a  UR                  OU/5        M8     [        [	        U5      5      $ )z
A validator that composes multiple validators into one.

When called on a value, it runs all wrapped validators.

Args:
    validators (~collections.abc.Iterable[typing.Callable]):
        Arbitrary number of validators.

.. versionadded:: 17.1.0
)r   rQ   r  r  rS   )
validatorsr  r>   s      r"   rU   rU     sM     D	)]33 !!	
   t%%r%   c                   ^  [        S T  5       5      nU(       a  U 4S jnOU 4S jnT (       d)  [        S5      nUR                  R                  X3S.5        O[	        T S   5      R                  5       nU(       a  XBR                  S'   T S   n[        (       d!  [        U[        5      (       a  UR                  n[	        U5      R                  5       nU(       a  XbR                  S	'   U(       a  [        US
S
S9$ U$ )aa  
A converter that composes multiple converters into one.

When called on a value, it runs all wrapped converters, returning the
*last* value.

Type annotations will be inferred from the wrapped converters', if they
have any.

    converters (~collections.abc.Iterable[typing.Callable]):
        Arbitrary number of converters.

.. versionadded:: 20.1.0
c              3  B   #    U  H  n[        U[        5      v   M     g 7fr5   rQ   r}  )r   cs     r"   r   pipe.<locals>.<genexpr>
  s     GJq*Q	22Js   c                f   > T H)  n[        U[        5      (       a	  U" XU5      OU" U 5      n M+     U $ r5   r%  )r  r   r  r&  
converterss       r"   pipe_converterpipe.<locals>.pipe_converter  s5    +5a+C+CAc'3   
 Jr%   c                *   > T H  nU" U 5      n M     U $ r5   r   )r  r&  r)  s     r"   r*  r+    s    f   Jr%   A)r  r  r   r  re   r  Tr  )r  r	   r   r7  r   r  r   rQ   r}  r  r  )r)  return_instancer*  r-  tlastr  s   `      r"   rT   rT     s      GJGGO		 CL&&--a.EF !A/DDF45**51"~|
4 ; ;==D "$'77979**84DdKKr%   )Nr  )
r^   r   r_   dict[str, Any] | Noner`   Mapping[str, object] | Nonera   r   r  r  r5   )
r^   r   ra   r   r_   r1  rm   r2  r  zdict[str, Any])r{   r   r|   z	list[str]r  r:   )r  z'tuple[list[Attribute], dict[str, type]])r  r   )T)NNNNNNNFFTFFFFFNNFFNNNTN)r   r:   r  r   r  r   )
r   r:   r   r   r&  r  r)  r  r  tuple[str, dict])r   r:   r   r   )r   rR   r  r3  )r  r3  )NN)r  tuple[str, dict, dict]r  r  )r   r   r   r   r{  r  r  r   )r&  r  r%  r  r   r   )r   r   r  r  r  r  r  r  rr  r  r  r  r  r  r   r   r*  r  rv  r  ru  r  r  r   r  r4  )r   r   r  r   )k
__future__r   rB  rI  r  r.   r  rZ  rj   ro  r  r  collections.abcr   r   	functoolsr   typingr   r   r	   r  r   r   r   r   r   r   r   r   r   
exceptionsr   r   r   r   objectr   r   r  r   rY  r  r  rH  rT   r   r  r  Enumr   r   intr2   rY   rc   rr   r   r   r   r   r   r   r   r   r   r   r   r   r  rL   r  r   r   r  r   r  r6  r  r  r  rR  r{  r`  r   rf  rk  r  r|  r  r  r  r  rn  r   r   rR  _ar   rA   rV   rP   _fr}  r  r  rU   )r   r   s   00r"   <module>r?     s    # 
       
   - % + + ( '   !!'   ) !2226  H	ll7??G4D4DE tyy ( 

( (" 				

h\ )-	     &  	 
 
 $ +/	    !  (	 
  F1.$* $0"'#,#B%8iEiEX1h"7tG	 G	T8((X .26 
			

1`F 
/E	E%E/3EAEEEP	"J5*p"6#r+\&:.$/B& B&J3]]"]48]EN]])
W
W"
W48
WEN
W
W,/,/,/.=,/^AAA A 	A
 A A A #A A A A A AHG Gp ## $ j %d+ $" )2&6"Q+ 5q"6 
=bFF1qvv'<1b
=	Q Qh 	-01$' $'h !! "  "  GIgR8C2
Na ab ; ;  ;  Iir*"5R	 yTdV Tt$	! 	! %	!&.9g( 7
=Dns0   #N8NNN
5N
N
N=N!