
    ,hy                   8   d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlmZmZ d dlmZ d dlmZmZmZ ddlmZmZmZ ddlmZmZmZmZmZmZ dd	lm Z m!Z!m"Z"m#Z# e$jJ                  Z&d
Z'dZ(dZ) e
jT                  i       Z+ e$       Z, ejZ                  ej\                  ej^                        Z0 G d dejb                        Z2e2jf                  Z3	  G d de4      Z5e3ddddddddddddddfdZ6	 	 dR	 	 	 	 	 	 	 	 	 dSdZ7	 dT	 	 	 	 	 	 	 	 	 dUdZ8dVdZ9 G d de      Z:d Z;d Z<	 	 dWdZ=d Z>	 	 dXdZ?d Z@d ZAd  ZBd! ZC G d" d#      ZDd$ ZEd% ZF	 dYd&ZG	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dZd'ZHeHZI	 d( ZJd[d)ZK	 	 	 	 	 	 	 	 	 	 d\d*ZLd]d+ZMd, ZNd^d-ZOd. ZPdTd/ZQd_d0ZRd`d1ZSd2 ZTd3 ZUd4 Z/d5 ZV	 	 dad6ZWdbd7ZX	 	 	 	 	 	 	 	 	 	 dcd9ZYddd:ZZ	 	 	 	 	 	 	 	 	 	 dcd;Z[	 	 	 	 	 	 ded<Z\	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dfd=Z]dgd>Z^ G d? d@      Z_e_j                  D  cg c]  }  e_| e3ddddd| dAk7  dd e^|       B        c} Za eM eQ eSe_eaC      eaD cg c]  }|j                  dDk7  s| c}C      eaD cg c]!  }|j                  s|j                  dDk7  s |# c}C      Z_ G dE dF      Zd eQ eSed            Zd G dG dH      Zeeej                  D  cg c]  }  e_| e3ddddddddI
       c} Zf eM eQ eSeeefC      efC      efC      Ze G dJ d8      ZgdKD  cg c]  }  e_| e3ddddddddI
       c} Zf eM eQ eSegefC      efC      efC      Zge$fdfdLZh eHddM       G dN dO             ZidP ZjdQ Z-yc c} w c c}w c c}w c c} w c c} w )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                  >    e Zd ZdZ ej
                         Zd Zd Zy)_NothingaF  
    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                     y)NNOTHING selfs    L/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/attr/_make.py__repr__z_Nothing.__repr__J   s        c                     y)NFr   r   s    r!   __bool__z_Nothing.__bool__M   s    r#   N)	__name__
__module____qualname____doc__enumautor   r"   r%   r   r#   r!   r   r   =   s      diikGr#   r   c                  (    e Zd ZdZ ed      dfdZy)_CacheHashWrappera  
    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                
    ||fS Nr   )r    _none_constructor_argss      r!   
__reduce__z_CacheHashWrapper.__reduce__e   s     %''r#   )r&   r'   r(   r)   typer2   r   r#   r!   r-   r-   Y   s    	 ,0:R (r#   r-   TFc                   t        |||d      \  }}}}||dur|durd}t        |      |	8| t        urd}t        |      t	        |	      sd}t        |      t        |	      } |i }t        |t        t        f      rt        j                  | }|rt        |t        t        f      rt        | }|rt        |t        t        f      rt        | }t        di d| d|d	|d
dd|d|d|d|d|d|
d|d|d|d|d|d|S )a  
    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metadatar3   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)r6   r7   r8   r9   r:   r;   r=   r3   r<   factoryr>   r?   rA   rC   rD   r@   rB   msgs                     r!   attribrR   i   s   n $>R$ By D,U1BFn'!O  S/! >CS/!'" *tUm,\\:.
Z	D%=9)$	Z	D%=9)$	   	
             ! r#   c                8    t        | |d      }t        |||       y)z[
    Evaluate the script with the given global (globs) and local (locs)
    variables.
    execN)compileeval)scriptglobslocsfilenamebytecodes        r!   _compile_and_evalr\      s     vx0H5$r#   c                    |i n|}d}|}	 t        |       d| j                  d      |f}t        j                  j	                  ||      }||k(  rn|dd  d| d}|dz  }Ut        | |||       |S )zP
    Cache the script with _linecache_, compile it and return the _locals_.
    Nr
   T->)len
splitlines	linecachecache
setdefaultr\   )	rW   rZ   rX   localsrY   countbase_filenamelinecache_tupleold_vals	            r!   _linecache_and_compilerk      s     2VD EM
Kd#	
 //,,XGo%#CR()5'3
  feT84Kr#   c                    |  d}i }t        |      D ]  \  }}|fd}t        |      ||<    t        |t        f|      S )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                    | |   S r/   r   )r    is     r!   getterz&_make_attr_tuple_class.<locals>.getter  s    7Nr#   )	enumeratepropertyr3   rL   )cls_name
attr_namesattr_class_namebodyro   	attr_namerp   s          r!   _make_attr_tuple_classrx     sX     "
*-OD!*- +9 	 #6*Y+ %400r#   c                  ,    e Zd ZU ded<   ded<   ded<   y)_Attributesr3   attrslist[Attribute]
base_attrsdict[str, type]base_attrs_mapN)r&   r'   r(   __annotations__r   r#   r!   rz   rz     s    K##r#   rz   c                    t        |       } | j                  d      r| j                  d      r| dd } | j                  t              S )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
   r^   )str
startswithendswith_CLASSVAR_PREFIXES)annots    r!   _is_class_varr   "  sE     JE 
#z(Ba.//r#   c                    || j                   v S )zR
    Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
    )__dict__)clsattrib_names     r!   _has_own_attributer   3  s     #,,&&r#   c                   g }i }t        | j                  dd       D ]a  }t        |dg       D ]O  }|j                  s|j                  |v r|j                  d      }|j                  |       |||j                  <   Q c g }t               }t        |      D ]>  }|j                  |v r|j                  d|       |j                  |j                         @ ||fS )zQ
    Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
    r
   r^   __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9 	-A{{aff(884(Aa $,M!&&!	-- H5Dj! 66T>1	 ]""r#   c                   g }i }| j                   dd D ]p  }t        |dg       D ]^  }|j                  |v r|j                  d      }|j	                  |j                         |j                  |       |||j                  <   ` r ||fS )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
   r^   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9 	-Avv))4(A  (a $,M!&&!	-- }$$r#   c                V   | j                   t        |       }|t        |j                               }n|du rj                         D 	ch c]  \  }}	|	j                  t
        u r| }
}}	g }t               }|j                         D ]h  \  }}t        |      r|j                  |       j                  |t              }|j                  t
        urt        |      }|j                  ||f       j |
|z
  }|rQt        ddj                  t        |fd            z   dz         t        d j                         D        d       }t         j"                  }|D cg c]  \  }} ||||j                  |              }}}|r(t%        | |D ch c]  }|j&                   c}      \  }}n't)        | |D ch c]  }|j&                   c}      \  }}|r>|D cg c]  }|j+                  d	       }}|D cg c]  }|j+                  d	       }}||z   }|t-         || |            }d
}d |D        D ]B  }|du r"|j.                  t        u rd|}t1        |      |d
u s.|j.                  t        usAd}D |D ]=  }|j2                  rt5        j7                  |      dt9        |j&                               ? |D cg c]  }|j&                   }}t;        | j<                  |      }t?         ||      ||      S c c}	}w c c}}w c c}w c c}w c c}w c c}w c c}w )a3  
    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                :    j                  |       j                  S r/   )getcounter)ncds    r!   <lambda>z"_transform_attrs.<locals>.<lambda>  s    bffQi6G6G r#   )key.c              3  N   K   | ]  \  }}|j                   t        u r||f  y wr/   )	__class__rO   ).0r   attrs      r!   	<genexpr>z#_transform_attrs.<locals>.<genexpr>  s,      D$>>]2 ts   #%c                     | d   j                   S Nr
   )r   )es    r!   r   z"_transform_attrs.<locals>.<lambda>  s    !A$,, r#   )r>   Fc              3  \   K   | ]$  }|j                   d us|j                  d u s!| & yw)FN)r;   r>   r   r   s     r!   r   z#_transform_attrs.<locals>.<genexpr>  s&     MA!&&"5!))u:LaMs   ,,,zlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: rD   ) r   r   rK   itemsr   rO   r   r   r   r   r   rR   r   r   joinsorted	Attributefrom_counting_attrr   r   r   r   rL   r6   rG   rD   _OBJ_SETATTR__get___default_init_alias_forrx   r&   rz   )r   theseauto_attribsr>   collect_by_mrofield_transformerannsca_listr   r   ca_namesannot_namesrw   r3   r   unannotatedfcaca	own_attrsr}   r   r{   had_defaultrQ   rt   
AttrsClassr   s                             @r!   _transform_attrsr   w  s:    
BC Du{{}%		 !hhj
d~~. 
 

 e#zz| 	+OItT"OOI&y'*A{{-/1INNIq>*	+ ,+C));,GH 	  "$((*
 '
 
&
&CEL4AIrIr488I./I  $7),Q!&&,%
!
M %?),Q!&&,%
!
M 5>?QXXdX+?	?6@Aahhth,A
A"E$'U34 KMM $199#7 A  BC  AF  GCS/!%AIIW$<K  Nww  #G-DQVV-LMN #((Q!&&(J('jAJz%(*mDDm
J - - @A> )s*   L"#LL
<L
L>L!L&c                   g d}||j                  d       n|j                  g d       |j                  ddg       t        |d      }| t        j                  |d}t        dj                  |      ||d	|i
      d   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)rf   __getattr__)r   extend_generate_unique_filenamer   r   rk   r   )r   r   r   linesunique_filenameglobs         r!   _make_cached_property_getattrr     s    E #:	
 			
 
LL$)	
 0Y?O /+33,D "		%/4 r#   c                f    t        | t              r|dv rt        j                  | ||       yt        )z4
    Attached to frozen classes as __setattr__.
    )	__cause____context____traceback____suppress_context__	__notes__N)rJ   BaseException__setattr__r   r    r   values      r!   _frozen_setattrsr     s7     $&4 4 , 	!!$e4
r#   c                d    t        | t              r|dv rt        j                  | |       yt        )z4
    Attached to frozen classes as __delattr__.
    )r   N)rJ   r   __delattr__r   )r    r   s     r!   _frozen_delattrsr   (  s.     $&4>+A!!$-
r#   c                    	 | \  }|j                  }t	        |      }|D ];  }|j
                  s|j                  }|j                  }||vs-t        ||      ||<   =  |di |S # t         $ r dt        |        d}t        |      dw xY w)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   )	rG   ra   rF   r   fieldsr;   r   rD   r   )	argschangesinstrQ   r   r{   r   rw   	init_names	            r!   r   r   3  s    J' ..C3KE :vvFF	GG	G#!(y!9GI: >>!  '8T;O 	 n$&	's   A% %%B
c                      e Zd ZdZdZ	 	 ddZd ZddZd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZddZddZy)_ClassBuilderz(
    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                x   t        ||||||      \  }}}|| _        |rt        |j                        ni | _        || _        |D ch c]  }|j                   c}| _        || _        t        d |D              | _
        || _        || _        || _        |	| _        t        t!        |dd            | _        d| _        | j"                  r>|j&                  }t)        j*                  |      }t-        |j.                        dkD  | _        t        t!        |dd            | _        t        |       | _        |
| _        || _        || _        d| _        | j
                  | j                  d<   |r.t<        | j                  d<   t>        | j                  d<   d	| _        n|t@        tB        jD                  tB        jF                  fv rldx}}|D ]%  }|jH                  d	}|jJ                  d	}|s"|s% n |t@        k(  r|s|r*|tB        jD                  k(  r|r|tB        jF                  k(  r	|sd | _        |r-| jM                         \  | j                  d
<   | j                  d<   g | _'        d| _(        tS        | j                  d      rtS        | j                  d      s| jT                  | _+        y | jX                  | _+        y c c}w )Nc              3  4   K   | ]  }|j                     y wr/   r   r   s     r!   r   z)_ClassBuilder.__init__.<locals>.<genexpr>  s      7A 7s   __attrs_pre_init__Fr
   __attrs_post_init__r   r   r   T__getstate____setstate__r'   r(   )-r   r   dictr   r   r   r   r   r   rL   r   r  r   r  r   boolr   r   r  r
  inspect	signaturera   
parametersr   r   r   r   r   r  r   r   _DEFAULT_ON_SETATTRr   validateconvertr7   r<   _make_getstate_setstater  r  hasattr_add_method_dunders_safer   _add_method_dunders_unsafe)r    r   r   slotsfrozenweakref_slotgetstate_setstater   r>   
cache_hashis_excr   rC   has_custom_setattrr   r{   r}   base_mapr   pre_init_funcpre_init_signaturehas_validatorhas_converters                          r!   __init__z_ClassBuilder.__init__  s   " '7'
#z8 	/4cll+",67qAFF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
 (,'D'DD$'+'F'FD$Y 8s   J7c                6    d| j                   j                   dS )Nz<_ClassBuilder(cls=z)>)r   r&   r   s    r!   r"   z_ClassBuilder.__repr__  s    $TYY%7%7$8;;r#   c                H   dj                  | j                  D cg c]  }|d   	 c}      }i }| j                  D ]  \  }}}|j                  |        t        |t	        | j
                  d      |      }| j                  D ]  \  }}} || j                  |        yc c}w )z=
        Evaluate any registered snippets in one go.
        r   r   methodsN)r   r  updaterk   r   r   r   )r    snippetrW   rX   _snippet_globsrY   hooks           r!   _eval_snippetsz_ClassBuilder._eval_snippets  s     d6K6KL7GAJLM#'#8#8 	(A}aLL'	( &%dii;
 // 	'JAq$&	' Ms   Bc                   | j                          | j                  du r| j                         }n+| j                         }t        rt        j                  |      }t        |dd      rd|j                  vr|j                          |S )z
        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   r1  )r    r   s     r!   build_classz_ClassBuilder.build_class
  sw     	;;$**,C,,.C005
 C2D9)='')
r#   c                   | j                   }| j                  }| j                  r\| j                  D ]M  }||vst	        ||t
              t
        us t        j                  t              5  t        ||       ddd       O | j                  j                         D ]  \  }}t        |||        | j                  s+t	        |dd      rd|_        | j                  st         |_        |S # 1 sw Y   xY w)zA
        Apply accumulated methods and return the class.
        N__attrs_own_setattr__F)r   r   r   r   r   	_SENTINEL
contextlibsuppressAttributeErrordelattrr   r   setattrr  r8  r   r   r   )r    r   
base_namesr   r   s        r!   r3  z#_ClassBuilder._patch_original_class"  s     ii%%
 (( 	+
*T95YF
 $,,^< +T*+ +	+  >>//1 	&KD%Cu%	&
 &&7(%,
 ).C%++".
#+ +s   *C))C2	c                   | j                   j                         D ci c]&  \  }}|g t        | j                        ddvr||( }}}| j                  sSd|d<   | j
                  sB| j                  j                  D ])  }|j                  j                  dd      s t        |d<    n i }d}| j                  j                  dd D ]U  }|j                  j                  dd      d	}|j                  t        |d
g       D ci c]  }|t        ||       c}       W t        | j                        }| j                  }	| j                   r$dt        | j                  d
d      vrd|	vr|s|	dz  }	|j                         D 
ci c]"  \  }}
t#        |
t$              r||
j&                  $ }}}
g }|rt)        | j                        }|j                         D ]`  \  }}|	|fz  }	||= |j+                  |       t-        j.                  |      j0                  }|t,        j2                  j4                  us\|||<   b |j                  d      }||j+                  |       t7        ||| j                        |d<   |	D cg c]	  }||vs| }}|j                         D ci c]  \  }}||v r|| }}}|D cg c]	  }||vs| }}|j                  |       | j8                  r|j+                  t:               t        |      |d
<   | j                  j<                  |d<    t?        | j                        | j                  j@                  | j                  j                  |      }tC        jD                  |j                  jG                         |      D ]  }t#        |tH        tJ        f      rt        |jL                  dd      }n5t#        |tN              rt        |jP                  dd      }nt        |dd      }|si|D ]%  }	 |jR                  | j                  u }|s||_)        '  |S c c}}w c c}w c c}
}w c c}w c c}}w c c}w # tT        $ r Y Xw xY w)zL
        Build and return a new class with a `__slots__` attribute.
        r   __weakref__Fr8  r   r
   r^   NT	__slots__r   )rA  r   r(   __closure__)+r   r   rL   r   r  r   r   	__bases__r   r   r   r   r*  r   r   r   r  rJ   r   funcr   r   r  r  return_annotation	Parameteremptyr   r   _HASH_CACHE_FIELDr(   r3   r&   	itertoolschainvaluesclassmethodstaticmethod__func__rr   fgetcell_contentsrG   )r    kvr   r   existing_slotsweakref_inheritedr   r?  namescached_propr   &additional_closure_functions_to_updateclass_annotationsrE  
annotationr   
slot_namesslotslot_descriptorreused_slotsr   itemclosure_cellscellmatchs                             r!   r2  z!_ClassBuilder._create_slots_classF  st    ,,.
1M% 0 01M:M}MM qD
 
 &&*/B&'++ $		 3 3 H((,,-DeL,8=) !		))!B/ 	H  $$]D9E$(!!! !(+r B '(D11	 ))*
  WTYYR%HHU*%%%E &(XXZ
!k+7 +"""
 
 24. 0 ;/557 9
d$ tH6==dC$..t4FF
W%6%6%<%<<.8%d+9  "vvm4+6==>NO =!#3TYY!B} (-GtJ0FdG
G *8)=)=)?
%oz! /!
 

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

 OJ " sA   +P*P0
'P5<	P;P;Q 7	QQQ	QQc                     t         j                  |      \  }} fd} j                  j                  |||f       d _         S )Nc                4    j                  |d         | d<   y )Nr"   r   cls_dictrX   r    s     r!   _attach_reprz,_ClassBuilder.add_repr.<locals>._attach_repr  s    #'#;#;E*<M#NHZ r#   T)_make_repr_scriptr   r  r   r  )r    nsrW   rX   rh  s   `    r!   add_reprz_ClassBuilder.add_repr  sG    )$++r:	O 	$$fe\%BCr#   c                z    | j                   sd}t        |      d }| j                  |      | j                  d<   | S )Nz3__str__ can only be generated if a __repr__ exists.c                "    | j                         S r/   r"   r   s    r!   __str__z&_ClassBuilder.add_str.<locals>.__str__  s    ==?"r#   ro  )r  rG   r   r   )r    rQ   ro  s      r!   add_strz_ClassBuilder.add_str  s?    GCS/!	# %)$<$<W$Ey!r#   c                t    t        d | j                  D              fd}| j                  fd}||fS )zF
        Create custom __setstate__ and __getstate__ methods.
        c              3  ,   K   | ]  }|d k7  s	|  yw)rA  Nr   )r   ans     r!   r   z8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>  s      !
R=-@B!
s   
c                D    D ci c]  }|t        | |       c}S c c}w )9
            Automatically created by attrs.
            r   )r    r   state_attr_namess     r!   slots_getstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate  s&     ;KK$D'$--KKKs   c                    t         j                  |       }t        |t              rt	        |      D ]  \  }} |||        nD ]  }||v s ||||           r |t
        d       yy)ru  N)r   r   rJ   rL   ziprI  )r    state_ClassBuilder__bound_setattrr   r   hash_caching_enabledrw  s        r!   slots_setstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstate  s     +2248O%' $''7#? 1KD%#D%01 - ;Du}'eDk:; $ 148 $r#   )rL   r   r   )r    rx  r~  r}  rw  s      @@r!   r  z%_ClassBuilder._make_getstate_setstate  sI    
 ! !
))!
 
	L  $//	9, ~--r#   c                $    d | j                   d<   | S N__hash__)r   r   s    r!   make_unhashablez_ClassBuilder.make_unhashable  s    %)z"r#   c                     t         j                   j                   j                   j                        \  }}d fd} j
                  j                  |||f        S )Nr  r  c                4    j                  |d         | d<   y r  re  )rg  rY   r    s     r!   attach_hashz+_ClassBuilder.add_hash.<locals>.attach_hash  s    #'#;#;D<L#MHZ r#   )rg  r  rY   r  returnNone)_make_hash_scriptr   r   r   r   r  r   )r    rW   rX   r  s   `   r!   add_hashz_ClassBuilder.add_hash  sW    )IIKK<<''	
	N 	$$fe[%ABr#   c                d    t         j                   j                   j                   j                   j
                   j                   j                   j                   j                   j                   j                  d      \  }} fd} j                  j                  |||f        S )NF
attrs_initc                F    |d   }|_         j                  |      | d<   y )Nr&  r   r   rg  rX   r;   r   r    s      r!   _attach_initz,_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    rW   rX   r  r   s   `   @r!   add_initz_ClassBuilder.add_init"  s    %6IIKK##LLKKLL&
"{	B
 	$$fe\%BCr#   c                D    | j                  d       | j                  d<   | S )Nc                    t        | fi |S r/   )r   )r    r   s     r!   r   z+_ClassBuilder.add_replace.<locals>.<lambda>=  s    F4$;7$; r#   __replace__)r   r   r   s    r!   add_replacez_ClassBuilder.add_replace;  s%    (,(@(@;)
}% r#   c                V    t        d | j                  D              | j                  d<   y )Nc              3  d   K   | ](  }|j                   r|j                  s|j                   * y wr/   )r;   r>   r   )r   fields     r!   r   z/_ClassBuilder.add_match_args.<locals>.<genexpr>B  s)      1
zz%-- JJ1
s   .0__match_args__)rL   r   r   r   s    r!   add_match_argsz_ClassBuilder.add_match_argsA  s'    +0 1
1
 ,
'(r#   c                d    t         j                   j                   j                   j                   j
                   j                   j                   j                   j                   j                   j                  d      \  }} fd} j                  j                  |||f        S )NTr  c                F    |d   }|_         j                  |      | d<   y )N__attrs_init__r  r  s      r!   _attach_attrs_initz8_ClassBuilder.add_attrs_init.<locals>._attach_attrs_initX  s,    )*D#.D )-)A)A$)GH%&r#   r  )r    rW   rX   r  r   s   `   @r!   add_attrs_initz_ClassBuilder.add_attrs_initH  s    %6IIKK##LLKKLL&
"{	H
 	$$fe5G%HIr#   c                      j                   }t         j                        \  }} fd} j                  j	                  |||f       t
        |d<    S )Nc                4    j                  |d         | d<   y )N__eq__re  rf  s     r!   
_attach_eqz(_ClassBuilder.add_eq.<locals>._attach_eqf  s    !%!9!9%/!JHXr#   __ne__)r   _make_eq_scriptr   r  r   r  )r    r   rW   rX   r  s   `    r!   add_eqz_ClassBuilder.add_eqa  sO    ^^'4	K 	$$feZ%@A8r#   c                      j                   } fdt         j                   j                        D        \  |d<   |d<   |d<   |d<    S )Nc              3  @   K   | ]  }j                  |        y wr/   re  )r   methr    s     r!   r   z*_ClassBuilder.add_order.<locals>.<genexpr>r  s&      B
 $$T*B
s   __lt____le____gt____ge__)r   _make_orderr   r   )r    r   s   ` r!   	add_orderz_ClassBuilder.add_ordero  sL    ^^B
#DIIt{{;B
>8blBxL"X,
 r#   c                \   i | j                   D ]C  }|j                  xs | j                  }|s |t        j                  us3||f|j
                  <   E s| S | j                  rd}t        |      fd}d| j                  d<   | j                  |      | j                  d<   d| _
        | S )Nz7Can't combine custom __setattr__ with on_setattr hooks.c                h    	 |   \  }} || ||      }t        | ||       y # t         $ r |}Y w xY wr/   )KeyErrorr   )r    r   valr   r.  nvalsa_attrss         r!   r   z._ClassBuilder.add_setattr.<locals>.__setattr__  sG    *"4.4 D!S)tT*  s   # 11Tr8  r   )r   rC   r   r   NO_OPr   r   rG   r   r   r  )r    r   rC   rQ   r   r  s        @r!   add_setattrz_ClassBuilder.add_setattry  s     	1A9)9)9Jj=#$j= 	1
 K##KCS/!	+ 37./(,(@(@(M}%"&r#   c                    | j                   j                  |_        | j                   j                   d|j                   |_        d| j                   j                   d|_        |S )z@
        Add __module__ and __qualname__ to a *method*.
        r   $Method generated by attrs for class )r   r'   r(   r&   r)   r    methods     r!   r  z(_ClassBuilder._add_method_dunders_unsafe  s`     !II00!%!7!7 8&//9JK 34993I3I2J!L 	 r#   c                   t        j                  t              5  | j                  j                  |_        ddd       t        j                  t              5  | j                  j
                   d|j                   |_        ddd       t        j                  t              5  d| j                  j
                   d|_        ddd       |S # 1 sw Y   xY w# 1 sw Y   XxY w# 1 sw Y   |S xY w)zL
        Add __module__ and __qualname__ to a *method* if possible.
        Nr   r  )r:  r;  r<  r   r'   r(   r&   r)   r  s     r!   r  z&_ClassBuilder._add_method_dunders_safe  s       0 	5 $		 4 4F	5   0 	P%)YY%;%;$<Afoo=N"OF	P   0 	^CDIIDZDZC[[\]FN	^ 	5 	5	P 	P	^ s#   C+C# C%CC"%C/N)r   r3   )r  r  )r  r   r  r   )r&   r'   r(   r)   rB  r&  r"   r/  r6  r3  r2  rk  rp  r  r  r  r  r  r  r  r  r  r  r  r  r   r#   r!   r   r   m  s    I0iGiGV<'$0"HIV	'.R2
2@r#   r   c                    | t        |du|duf      rd}t        |      | | | fS ||}||}|du r|du rd}t        |      ||fS )
    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.anyrG   )r9   r?   rA   
default_eqrQ   s        r!   _determine_attrs_eq_orderr    sy    
 3$T0ABC6o Cx 
z}	U{u}=ou9r#   c                    | t        |du|duf      rd}t        |      d }|  ||       \  } }| || |fS ||d}}n ||      \  }}|||}}n ||      \  }}|du r|du rd}t        |      ||||fS )r  Nr  c                4    t        |       rd| }} | |fS d}| |fS )z8
        Decide whether a key function is used.
        TN)rH   )r   r   s     r!   decide_callable_or_booleanz>_determine_attrib_eq_order.<locals>.decide_callable_or_boolean  s1     E?u3E cz Cczr#   FTr  r  )	r9   r?   rA   r  rQ   r  cmp_keyr@   rB   s	            r!   rE   rE     s    
 3$T0ABC6o 1#6WGS')) 
zF/3
F}vy5e<y	U{u}=ovui''r#   c                T    |du s|du r|S ||du r|S |D ]  }t        | |      s y |S )ap  
    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dundersr6   dunders         r!   _determine_whether_to_implementr    sL     t|tu}|u,  c6* Nr#   c                4  	
  ddl }|j                  t        d      d       t        |||d      \  ||t	        t
        t        f      rt        j                   
	fd}| |S  ||       S )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                   xs t        |       }	du xr t        | t              }xr t        | d      }|r|rd}t	        |      t        | |t        | d      
||      }t        | d      r|j                         du r|j                          t        | d      }|s|du r|j                          |st        | d      r|j                          s|j                          du rt        | d	      rd
durd
urd}t        |      d
u s|d
u s|r
rKd}t        |      du s
|du r|du r|j                          n
rd}t        |      |j                          t        | d      r|j                          n|j!                          
rd}t        |      t"        rt        | d      s|j%                          t&        rrt        | d      s|j)                          |j+                         S )NTr   z/Can't freeze a class with a custom __setattr__.)r  r  )r6   rn  )r  r  )r  r  r  r  r  Fr5   zlInvalid value for cache_hash.  To use hash caching, hashing must be either explicitly or implicitly enabled.r&  zFInvalid value for cache_hash.  To use hash caching, init must be True.r  r  )_has_frozen_base_class
issubclassr   r   rG   r   r  rk  rp  r  r  r  rF   r  r  r  r  r   r  r   r  r6  )r   	is_frozenr  has_own_setattrrQ   builderr?   r   r  auto_excr  r   eq_r   r  r  r:   r;   r>   
match_argsrC   order_r8   repr_nsr  r   r   r  s          r!   wrapzattrs.<locals>.wrap  sh   94S9	T!Djm&D% 
*<+
 yCCS/!+!0 )
. +{M
 W%$;OO,k#7
 "*NN9&N
 ! Lt#"3
3DtE 1d6FJCC. 5=T\bEkf  En$T\LR4ZI,=   En$##%*{M
 ""$^n$ 23 F! &s,<=""$""$$r#   )	warningswarnDeprecationWarningr  rJ   rK   rL   r   rM   )	maybe_clsr   r  r8   r9   r:   r;   r  r  r  r   r   r>   r  r  r?   rA   r  r   r  rC   r   r  unsafe_hashr  r  r  r  s    ``` ``````````  ``````   @@r!   r{   r{     s    x c 	 	 	
 ,CUDAKC *tUm,\\:.
j% j% j% j%\ 	?r#   c                &    | j                   t        u S )zV
    Check whether *cls* has a frozen ancestor by looking at its
    __setattr__.
    )r   r   )r   s    r!   r  r    s    
 ??...r#   c           
     X    d| d| j                    dt        | d| j                         dS )zF
    Create a "filename" suitable for a function being generated.
    z<attrs generated  r   r(   r`   )r'   r   r&   )r   	func_names     r!   r   r   
  s7    
 I;a'7q35
6a	9r#   c                  	
 t        d D              d}t        t        | d            i 	d}d
d|s|dz  }n|dz  }|d	z  }d

z   
dz  |g	
fd}|rzj                  |dt         dz          |r, |dt         d|dz         j                  |dz  dz          n |dt         d|dz         j                  |dt         z          n	 |d|       dj                        }|	fS )Nc              3  t   K   | ]0  }|j                   d u s|j                   |j                  d u s-| 2 yw)TN)r:   r?   r   s     r!   r   z$_make_hash_script.<locals>.<genexpr>  s1      AFFdNqvv~!$$$,s   888        r:   zdef __hash__(selfzhash((z))z):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper()c           	     h   j                  || z   z   |d	 dz   g       D ]u  }|j                  rEd|j                   d}|j                  |<   j                  |d| d|j                   dz          Tj                  |d|j                   dz          w j                  |dz   z          y	)
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  ,r,  _key(self.z),        self.    N)r   r@   r   r   )
prefixindentr   cmp_namer{   closing_bracesrX   	hash_funcmethod_lines	type_hashs
       r!   append_hash_computation_linesz8_make_hash_script.<locals>.append_hash_computation_lines/  s     	)+8I;a00	
  	HAxxqvvhd+"#((h##xzxrBB ##F}QVVHA-F$FG	H 	FVOn<=r#   zif self.z	 is None:zobject.__setattr__(self, '', r  self. = zreturn self.zreturn r   )rL   r:   r   r   rI  r   )r   r{   r  r  tabhash_defr  rW   r  rX   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                n    t        | |dd      \  }}t        ||t        | d             |d   | _        | S )z%
    Add a hash method to *cls*.
    Fr  r  rZ   )r  r\   r   r  r   r{   rW   rX   s       r!   	_add_hashr  \  sG     &U5UMFE  9#z J $CLJr#   c                F    | j                  |      }|t        u rt        S | S )z^
    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                ,   | D cg c]  }|j                   s| } }g d}i }| r|j                  d       | D ]  }|j                  rRd|j                   d}|j                  ||<   |j                  d| d|j                   d| d|j                   d		       n+|j                  d
|j                   d|j                          || d   us|d    d|d<    |j                  d       n|j                  d       dj	                  |      }||fS c c}w )z6
    Create __eq__ method for *cls* with *attrs*.
    )zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz    return  (r,  r  r  r  z) == z(other.r  r  z
 == other.r^   z andz    )z    return Truer   )r?   r   r@   r   r   )r{   r   r   rX   r  rW   s         r!   r  r  v  s    &1Q&E&E E_% 	/Axxqvvhd+ #$((hxjqvvheH:WQVVHTUV }QVVHJqvvhGHb	!$Ryk.b		/ 	W&'YYuF5== 's
   DDc                    D cg c]  }|j                   s| c}fdfd}fd}fd}fd}||||fS c c}w )z9
    Create ordering methods for *cls* with *attrs*.
    c                <     t        d  fdD        D              S )z&
        Save us some typing.
        c              3  :   K   | ]  \  }}|r ||      n|  y wr/   r   )r   r   r   s      r!   r   z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>  s'      
s CJ5(
s   c              3  b   K   | ]&  }t        |j                        |j                  f ( y wr/   )r   r   rB   )r   r   objs     r!   r   z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>  s*      89aff%q{{3s   ,/)rL   )r  r{   s   `r!   attrs_to_tuplez#_make_order.<locals>.attrs_to_tuple  s)      
=B
 
 	
r#   c                b    |j                   | j                   u r |        |      k  S t        S z1
        Automatically created by attrs.
        r   r  r    r  r  s     r!   r  z_make_order.<locals>.__lt__  0     ??dnn,!$'.*???r#   c                b    |j                   | j                   u r |        |      k  S t        S r  r  r  s     r!   r  z_make_order.<locals>.__le__  0     ??dnn,!$'>%+@@@r#   c                b    |j                   | j                   u r |        |      kD  S t        S r  r  r  s     r!   r  z_make_order.<locals>.__gt__  r  r#   c                b    |j                   | j                   u r |        |      k\  S t        S r  r  r  s     r!   r  z_make_order.<locals>.__ge__  r  r#   )rA   )r   r{   r   r  r  r  r  r  s    `     @r!   r  r    sK     )1Q)E	
 666))c *s   ??c                    || j                   }t        |      \  }}t        ||t        | d             |d   | _        t
        | _        | S )z5
    Add equality methods to *cls* with *attrs*.
    r  r  )r   r  r\   r   r  r  r  s       r!   _add_eqr    sR     }###E*MFE 9#x H xCJCJJr#   c                   t        d | D              }|D ci c]  \  }}}|t        k7  s|dz   | }}}}t        |d<   t        |d<   t        |d<   g }|D ]B  \  }}}|rd|z   nd|z   dz   }	|t        k(  r|d	|	d
n
|d	|d|	d}
|j                  |
       D dj                  |      }|d}n|dz   }ddddddddddddd| d| dddg}d j                  |      |fS c c}}}w )!zC
    Create the source and globs for a __repr__ and return it.
    c              3     K   | ]I  }|j                   d ur9|j                  |j                   du rt         n|j                   |j                  f K yw)FTN)r8   r   r;   r   s     r!   r   z$_make_repr_script.<locals>.<genexpr>  sC      "66 
!&&D.$affqvv>"s   AA_reprr   r<  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   )rL   r8   r   r<  r   r   r   )r{   rj  attr_names_with_reprsr   rr,  rX   attribute_fragmentsro   accessorfragmentrepr_fragmentcls_name_fragmentr   s                 r!   ri  ri    sg    " ""  -B (dAqQ$YwE  E),E
E)+ 	-
aGdN%6%=%M 	
 Dy  *'+T8< 	
 	""8,	- II12M	zO!== 	D"+D--
)*!M?"=.E$ 99UU""Us
   C"C"c                    || j                   }t        ||      \  }}t        ||t        | d             |d   | _        | S )z%
    Add a repr method to *cls*.
    r"   r  )r   ri  r\   r   r"   )r   rj  r{   rW   rX   s        r!   	_add_reprr(    sN     }##%eR0MFE 9#z J $CLJr#   c                    t        |       }|t        | t              sd}t        |      t	        | dd      }|*|t	        |dd      }|	|| _        |S | d}t        |      |S )aG  
    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   rJ   r3   rF   r   r   r   )r   generic_baserQ   r{   s       r!   r   r   ,  s    . $C(LJsD$9.nC*D1E}#L*;TBE  ',#89"3''Lr#   c                    t        | t              sd}t        |      t        | dd      }|| d}t	        |      |D ci c]  }|j
                  | c}S c c}w )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
    r*  r   Nr+  )rJ   r3   rF   r   r   r   )r   rQ   r{   r   s       r!   fields_dictr.  Z  se    & c4 .nC*D1E}89"3''$%!AFFAI%%%s   Ac           	         t         j                  du ryt        | j                        D ]/  }|j                  }| || |t        | |j                               1 y)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   r7   r   r   )r   r   rS  s      r!   r  r  w  sR     %'DNN# .KK=dAwtQVV,-.r#   c                H    |j                  |       }|xr d|j                  v S )z>
    Check if the attribute name comes from a slot class.
    rB  )r   r   )a_namer   r   s      r!   _is_slot_attrr3    s(     

F
#C.;#,,..r#   c                   |
d uxr |
t         j                  u}|r|rd}t        |      |xs |}g }i }|D ]  }|j                  s|j                  t
        u r"|j                  |       |||j                  <   |j                  |du rd}t        |      d}b|se|j                  t         j                  usd} t        |||||||||	|||rdnd      \  }}}| j                  t        j                  v r6|j                  t        j                  | j                     j                         |j                  t
        |d       |rt        j                   |d<   |||fS )Nz$Frozen classes can't use on_setattr.Tr  r&  )r   	attr_dictr   )r   r  rG   r;   r6   r   r   r   rC   _attrs_to_init_scriptr'   sysmodulesr*  r   r   r   )r   r{   pre_initpre_init_has_args	post_initr  r  r  r   r  cls_on_setattrr  has_cls_on_setattrrQ   needs_cached_setattrfiltered_attrsr5  r   rW   rX   r   s                        r!   r  r    sj    	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                    d|  d| dS )zJ
    Use the cached object.setattr to set *attr_name* to *value_var*.
    
_setattr('r  r  r   )rw   	value_varhas_on_setattrs      r!   _setattrrD    s     	{#i[22r#   	Converterc                4    d|  d|j                  | |       dS )zk
    Use the cached object.setattr to set *attr_name* to *value_var*, but run
    its converter first.
    rA  r  r  )_fmt_converter_callrw   rB  rC  r<   s       r!   _setattr_with_converterrI    s(     	{#i&C&CIy&Y%ZZ[\\r#   c                0    |rt        | |d      S d|  d| S )zo
    Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
    relegate to _setattr.
    Tr  r  )rD  )rw   r   rC  s      r!   _assignrK    s)    
 	5$//9+S((r#   c                R    |rt        | |d|      S d|  d|j                  | |       S )z
    Unless *attr_name* has an on_setattr hook, use normal assignment after
    conversion. Otherwise relegate to _setattr_with_converter.
    Tr  r  )rI  rG  rH  s       r!   _assign_with_converterrM    s9     &y)T9MM9+S!>!>y)!T UVVr#   c                    | du r4|du rdt         t        fS 	 	 	 	 	 	 	 	 dfd}	 	 	 	 	 	 	 	 	 	 dfd}d||fS dt        t        fS )zg
    Determine the correct setter functions based on whether a class is frozen
    and/or slotted.
    Tr   c                F    t        |       rt        | ||      S d|  d| S N_inst_dict['z'] = )r3  rD  )rw   rB  rC  r   s      r!   
fmt_setterz&_determine_setters.<locals>.fmt_setter  s1     Y6	9nEE!)E)==r#   c                l    |st        |       rt        | |||      S d|  d|j                  | |       S rP  )r3  rI  rG  )rw   rB  rC  r<   r   s       r!   fmt_setter_with_converterz5_determine_setters.<locals>.fmt_setter_with_converter  sL     y-!H.y.)  ")E)2O2OPY[d2e1fggr#   )z_inst_dict = self.__dict__rw   r   rB  r   rC  r  r  r   
rw   r   rB  r   rC  r  r<   rE  r  r   )rD  rI  rK  rM  )r  r  r   rR  rT  s     `  r!   _determine_settersrW    s     ~D=x!888	>	>'*	><@	>	>	h	h	h !	h !		h
 	h ,%
 	
 w...r#   c           
     d   |rdgng }|	r|j                  d       t        |||      \  }}}|j                  |       g }g }g }i }ddi}| D ]  }|j                  r|j                  |       |j                  }|j
                  duxs  |j
                  t        j                  uxr |
}|j                  }t        |j                  t              }|r|j                  j                  rdnd}|j                  0t        |j                  t              st        |j                        }n|j                  }|j                  du r|rt         |j                  fz  }|J|j                   |||d| d	z   ||             |j                  ||j#                  |j                        <   n |j                   |||d| d	z   |             |j                  j$                  ||<   n|H|j                   ||d
| d||             |j                  ||j#                  |j                        <   n|j                   ||d
| d|             n|j                  t&        ur|s| d| d}|j(                  r|j                  |       n|j                  |       |D|j                   |||||             |j                  ||j#                  |j                        <   n|j                   ||||             n|rH| d}|j(                  r|j                  |       n|j                  |       |j                  d| d       t         |j                  fz  }|}|j                  d |||||      z          |j                  d       |j                  d |||dz   |z   d	z   ||      z          |j                  ||j#                  |j                        <   nR|j                  d ||||      z          |j                  d       |j                  d |||dz   |z   d	z   |      z          |j                  j$                  ||<   n|j(                  r|j                  |       n|j                  |       |C|j                   |||||             |j                  ||j#                  |j                        <   n|j                   ||||             |j                  du s|j*                  ||j*                  ||<   ||j,                  s|j,                  ||<    |rxt.        |d<   |j                  d       |D ]Y  }d|j                  z   }d|j                  z   }|j                  d| d| d|j                   d	       |j                  ||<   |||<   [ |r|j                  d       |r5|r|rdt0         d}ndt0         d}n
dt0         d}|j                  |       |r-d j3                  d! | D              } |j                  d"|  d	       d#j3                  |      }|}!|rV||rd#nd d$d#j3                  |       z  }d#j3                  d% |D        D "cg c]	  }"|" d&|"  c}"      }#|!|!rd#ndz  }!|!|#z  }!|r|r	d'|! d	|d(<   d)}$d*| d| d+|r|$j3                  |      nd, d-||fS c c}"w ).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     Fr  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__()rA  z', None)rQ  z	'] = Noner  z = Noner  c              3  T   K   | ]   }|j                   sd |j                    " yw)r  N)r;   r   r   s     r!   r   z(_attrs_to_init_script.<locals>.<genexpr>	  s!     BQ166%x(Bs   ((zBaseException.__init__(self, r   z*, c              3  D   K   | ]  }|j                  d       d     yw)=r   N)split)r   kwas     r!   r   z(_attrs_to_init_script.<locals>.<genexpr>	  s     #N#CIIcN1$5#Ns    r^  zself.__attrs_pre_init__(r   z
    zdef z):
    passr   )r   rW  r   r7   r   rC   r   r  rD   rJ   r6   rI   
takes_selfr<   rE  r;   _INIT_FACTORY_PAT_get_global_namerP   r   r>   r3   _first_param_typer   rI  r   )%r{   r  
is_slottedcall_pre_initr:  call_post_initdoes_cache_hashr   r  r>  r=  method_namer   extra_linesrR  rT  r   kw_only_argsattrs_to_validatenames_for_globalsr   r   rw   rC  arg_namehas_factory
maybe_selfr<   init_factory_nameargval_nameinit_hash_cachevalspre_init_argskw_arg_namepre_init_kw_only_argsNLs%                                        r!   r6  r6  .  s0   ( .;()E 3		
 :L:}:6K6 
LLDL T"K UD;;$$Q'FF	T1 
LL-D2D 	
 77 G4*qyy/C/CV
;;":akk9+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(1(C(CH%kUD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   -q.!
 	B6..*-m_A>a 
BWTF +RWWU^&) *	 	 s   Z-c                $    | j                  d      S )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.
    r,  )lstripr	  s    r!   r   r   2	  s     ;;sr#   c                  b    e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 ddZd Zeddd       Zd Z	d Z
d	 Zd
 Zy)r   a  
    *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   r6   r7   r8   r?   r@   rA   rB   r:   r;   r=   r3   r<   r>   r   rC   rD   Nc                   t        ||xs ||xs |d      \  }}}}t        j                  |       } |d|        |d|        |d|        |d|        |d|        |d|        |d|        |d	|        |d
|        |d|        |d|        |d|	rt        j                  t        |	            nt                |d|
        |d|        |d|        |d|        |d|       y )NTr   r6   r7   r8   r?   r@   rA   rB   r:   r;   r<   r=   r3   r>   r   rC   rD   )rE   r   r   typesMappingProxyTyper  _EMPTY_METADATA_SINGLETON)r    r   r6   r7   r8   r9   r:   r;   r   r=   r3   r<   r>   r?   r@   rA   rB   rC   rD   bound_setattrs                       r!   r&  zAttribute.__init__~	  s   * (B2y1E4(
$FE9
 %,,T2 	fd#i)k9-fd#dBh'gu%k9-fd#fd#k9-  &&tH~6.	
 	fd#i)k9-lJ/gu%r#   c                    t         r/   )r   r   s      r!   r   zAttribute.__setattr__	  s    !!r#   c                   ||j                   }n|j                   d| d}t        |       | ||j                  |j                  |j                  d |j
                  |j                  d|j                  ||j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                        S )Nz>Type annotation and type argument cannot both be present for 'z'.F)r3   rG   _default
_validatorr8   r:   r;   r=   r<   r>   r?   r@   rA   rB   rC   rD   )r   r   r   r3   rQ   s        r!   r   z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                n    t        j                   |       }|j                  |j                                |S )a
  
        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   zAttribute.evolve	  s(     iiogmmo&
r#   c                @     t         fd j                  D              S )(
        Play nice with pickle.
        c              3  j   K   | ]*  }|d k7  rt        |      nt        j                         , yw)r=   N)r   r  r=   r   r   r    s     r!   r   z)Attribute.__getstate__.<locals>.<genexpr>	  s5      
 $(:#5GD$4;NN
s   03rL   rB  r   s   `r!   r  zAttribute.__getstate__	  s#      

 
 	
r#   c                N    | j                  t        | j                  |             yr  N)r  rz  rB  r    r{  s     r!   r  zAttribute.__setstate__	  s     	s4>>512r#   c           	         t         j                  |       }|D ]A  \  }}|dk7  r
 |||        |||rt        j                  t	        |            nt
               C y )Nr=   )r   r   r  r  r  r  )r    name_values_pairsr  r   r   s        r!   r  zAttribute._setattrs	  s^    $,,T2, 	KD%z!dE* ! ..tE{;6		r#   )
NNNFNNNNNNr/   )r   r   r   rO   )r&   r'   r(   r)   rB  r&  r   rM  r   r   r  r  r  r   r#   r!   r   r   =	  sb    (XI< '5&n" 
 
:$
3r#   r   r=   )r   r6   r7   r8   r9   r?   rA   r:   r;   r   rD   )r{   r   c                  |    e Zd ZdZdZg  ed dD               eddddddddddddddd	      Zd
Zd Z	d Z
d Zy)rO   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  rD   r<   r   r?   r@   r:   r;   r>   r=   rC   rA   rB   r8   r3   c              #  j   K   | ]+  }t        |t        |      t        d dd ddddd dd dd        - y w)NTFr   rD   r6   r7   r8   r9   r:   r;   r>   r?   r@   rA   rB   r   rC   )r   r   r   )r   r   s     r!   r   z_CountingAttr.<genexpr>=
  sV      
$ # -d3 
s   13)	r   r  r8   r?   rA   r:   r;   rC   rD   r=   NTFr  r   c                2   t         xj                  dz  c_        t         j                  | _        || _        || _        || _        || _        || _        || _        || _	        || _
        || _        || _        || _        |	| _        |
| _        || _        || _        y r   )rO   cls_counterr   r  r  r<   r8   r?   r@   rA   rB   r:   r;   r=   r3   r>   rC   rD   )r    r6   r7   r8   r9   r:   r;   r<   r=   r3   r>   r?   r@   rA   rB   rC   rD   s                    r!   r&  z_CountingAttr.__init__o
  s    & 	!!Q&!$00#"	
"		 	$
r#   c                f    | j                   	|| _         |S t        | j                   |      | _         |S )z
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        )r  rN   r    r  s     r!   r7   z_CountingAttr.validator
  s5     ??""DO  #4??D9DOr#   c                Z    | j                   t        urt        t        |d      | _         |S )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)rb  )r  r   r   rI   r  s     r!   r6   z_CountingAttr.default
  s)     =='((6r#   )r&   r'   r(   r)   rB  rL   r   r   r  r&  r7   r6   r   r#   r!   rO   rO   !
  s    I$0	 
$
%
 

0> 		
?0Ob K#Jr#   rO   c                  (    e Zd ZdZdZddZd Zd Zy)rI   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*
    rP   rb  c                     || _         || _        y r/   r  )r    rP   rb  s      r!   r&  zFactory.__init__
  s    $r#   c                @     t         fd j                  D              S )r  c              3  6   K   | ]  }t        |        y wr/   rv  r  s     r!   r   z'Factory.__getstate__.<locals>.<genexpr>
  s     DTWT4(Ds   r  r   s   `r!   r  zFactory.__getstate__
  s     DT^^DDDr#   c                Z    t        | j                  |      D ]  \  }}t        | ||        yr  )rz  rB  r>  )r    r{  r   r   s       r!   r  zFactory.__setstate__
  s.     t~~u5 	'KD%D$&	'r#   N)F)r&   r'   r(   r)   rB  r&  r  r  r   r#   r!   rI   rI   
  s    $ *I%E'r#   rI   )
r   r6   r7   r8   r9   r?   rA   r:   r;   r   c                  H    e Zd ZdZdZddddZedd       ZddZd Z	d	 Z
y
)rE  ae  
    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__re  _global_namer<   takes_fieldrb  Frb  r  c                   | _         | _        | _        t        |      }|j	                          _         j                  s j                  s fd _        nP j                  r j                  s fd _        n- j                  s j                  r fd _        n
 fd _        |j                         }|| j                  j                  d<   y y )Nc                &    j                  |       S r/   r<   )r   r,  __r    s      r!   r   z$Converter.__init__.<locals>.<lambda>  s    1F r#   c                (    j                  | |      S r/   r  )r   instancer  r    s      r!   r   z$Converter.__init__.<locals>.<lambda>  s    x9 r#   c                (    j                  | |      S r/   r  )r   r  r  r    s      r!   r   z$Converter.__init__.<locals>.<lambda>  s    T^^u6 r#   c                *    j                  | ||      S r/   r  )r   r  r  r    s      r!   r   z$Converter.__init__.<locals>.<lambda>#  s    4>>x< r#   r  )	r<   rb  r  r   get_first_param_typere  r  get_return_typer   )r    r<   rb  r  exrts   `     r!   r&  zConverter.__init__  s    "$&!),!#!8!8!:4#3#3FDM__T%5%5DM T%5%5DMDM !>68DMM))(3 r#   c                    d|  S )zh
        Return the name that a converter for an attribute name *attr_name*
        would have.
        __attr_converter_r   )rw   s    r!   rd  zConverter._get_global_name+  s     #9+..r#   c                >   | j                   s#| j                  s| j                  |       d| dS | j                   r&| j                  r| j                  |       d| d| dS | j                   r| j                  |       d| dS | j                  |       d| d| dS )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`.
        r  r  z, self, attr_dict['z'])z, self)z, attr_dict[')rb  r  rd  )r    rw   rB  s      r!   rG  z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    | j                   | j                  | j                  dS )zx
        Return a dict containing only converter and takes_self -- the rest gets
        computed when loading.
        r<   rb  r  r  r   s    r!   r  zConverter.__getstate__D  s%     //++
 	
r#   c                (     | j                   di | y)z+
        Load instance from state.
        Nr   r  r  s     r!   r  zConverter.__setstate__O  s     	r#   N)rw   r   r  r   )rw   r   rB  r   r  r   )r&   r'   r(   r)   rB  r&  rN  rd  rG  r  r  r   r#   r!   rE  rE  
  s>    (I 165 96 / /\"	
r#   r  c                   t        j                  d|       } t        |t              r|}n<t        |t        t
        f      r|D ci c]  }|t                }}nd}t        |      |j                  dd      }|j                  dd      }	|j                  dd      }
i |j                  |       ||d<   |	|	d<   |
|
d<   t        j                  | |i fd      }t        j                  t        t              5  t!        j"                  d      j$                  j'                  d	d
      |_        ddd       |j                  dd      }t+        ||j'                  d      |j'                  d      d      \  |d<   |d<    t-        dd|i||      }|j/                         D ci c]  \  }}|j0                  ||j0                  ! c}}|_        |S c c}w # 1 sw Y   xY wc c}}w )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  r&  c                &    | j                        S r/   )r*  )rj  rv   s    r!   r   zmake_class.<locals>.<lambda>  s    		$ r#   r
   r&   __main__r9   r?   rA   Tr   r   )unicodedata	normalizerJ   r  rK   rL   rR   rF   popr*  r  	new_classr:  r;  r<  rG   r7  	_getframe	f_globalsr   r'   r  r   r   r3   r   )r   r{   bases
class_bodyattributes_argumentsrg  r   rQ   r9  r;  	user_inittype_r9   r   rR  rS  rv   s                   @r!   
make_classr  k  s   `   .D%	ED%=	))./AAvxK//8n||0$7H2D9IZ.IDJ%-!"&/"#$ZOOD%-GHE 
		^Z	8 
==+5599


 
"
"5$
/C 	"  &  )		T"W% 9&
8x
8#7
8
?C 'nn.a!&&2D166	C J_ 02
 
&s   G 5G*G*?G*G')r  r  c                  $    e Zd ZdZ e       Zd Zy)_AndValidatorz2
    Compose many validators to a single one.
    c                :    | j                   D ]  } ||||        y r/   )_validators)r    r   r   r   rS  s        r!   r  z_AndValidator.__call__  s#    !! 	!AdD% 	!r#   N)r&   r'   r(   r)   rR   r  r  r   r#   r!   r  r    s     (K!r#   r  c                     g }| D ]0  }|j                  t        |t              r|j                  n|g       2 t        t	        |            S )a  
    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   rJ   r  r  rL   )
validatorsrv  r7   s      r!   rN   rN     sO     D 
	)]3 !!	

 t%%r#   c                     t        d  D              }|r fd}n fd} s*t        d      }|j                  j                  ||d       n~t	         d         j                         }|r||j                  d<    d   }t        st        |t              r|j                  }t	        |      j                         }|r||j                  d	<   |rt        |d
d
      S |S )a  
    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  <   K   | ]  }t        |t                y wr/   rJ   rE  )r   cs     r!   r   zpipe.<locals>.<genexpr>
  s     Gq*Q	2Gs   c                Z    D ]$  }t        |t              r
 || ||      n ||       } & | S r/   r  )r  r   r  r  
converterss       r!   pipe_converterzpipe.<locals>.pipe_converter  s9     +5a+CAc4'3 
 Jr#   c                &    D ]
  } ||       }  | S r/   r   )r  r  r  s     r!   r  zpipe.<locals>.pipe_converter  s"     f Jr#   A)r  r  r   r  r^   r  Tr  )r  r	   r   r*  r   r  r   rJ   rE  r  r  )r  return_instancer  r  tlastr  s   `      r!   rM   rM     s      GJGGO		 CL&&--a1.EF !A/DDF45N**51"~
4 ;==D "$'77979N**84DdKKr#   )NrY  )
rW   r   rX   dict[str, Any] | NonerY   Mapping[str, object] | NonerZ   r   r  r  r/   )
rW   r   rZ   r   rX   r  rf   r  r  zdict[str, Any])rs   r   rt   z	list[str]r  r3   )r  z'tuple[list[Attribute], dict[str, type]])r  rz   )T)NNNNNNNFFTFFFFFNNFFNNNTN)r   r3   r  r   r  r   )
r   r3   r{   r|   r  r  r  r  r  tuple[str, dict])r   r3   r{   r|   )r{   rK   r  r  )r  r  )NN)r  tuple[str, dict, dict]rU  rV  )rw   r   r   r   rC  r  r  r   )r  r  r  r  r   r~   )r{   r|   r  r  rf  r  rg  r  r:  r  rh  r  ri  r  r   r~   r  r  r>  r  r=  r  rj  r   r  r  )r   r   r  r   )k
__future__r   r4  r:  r  r*   r  rJ  rc   r7  r  r  collections.abcr   r   	functoolsr   typingr   r   r	   rY  r   r   r   r   r   r   r   r   r   
exceptionsr   r   r   r   objectr   r   rc  r   rI  r  r  r9  rM   r  r  r  Enumr   r   intr-   rR   r\   rk   rx   rz   r   r   r   r   r   r   r   r   r   r   r  rE   r  r{   r   r  r   r  r  r  r  r  r  ri  r(  r   r.  r3  r  rD  rI  rK  rM  rW  r6  r   r   rB  _ar   r:   rO   rI   _frE  r  r  rN   )r   r   s   00r!   <module>r     s	   # 
       
   - % + + ( '   !!'   ) 2E2226  H	"gll7??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&6Q+ 5q6 
=AFFqvv'<1
=	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"N7NN
N
(N
$N(N