
    ei͖                      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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%j&        Z'd
Z(dZ)dZ* e
j+        i           Z, e%            Z- ej.        ej/        ej0                  Z1 G d dej2                  Z3e3j4        Z4	  G d de5          Z6e4ddddddddddddddfdZ7	 	 dddZ8	 ddd Z9dd%Z: G d& d'e          Z;d( Z<d) Z=dd+Z>d, Z?dd-Z@d. ZAd/ ZBd0 ZCd1 ZD G d2 d3          ZEd4 ZFd5 ZG	 dd6ZH	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd8ZIeIZJ	 d9 ZKdd<ZLddCZMddDZNdE ZOddGZPdH ZQddIZRddJZSddKZTdL ZUdM ZVdN Z0dO ZWddQZXddUZYddXZZddZZ[dd[Z\dd_Z]ddjZ^ddlZ_ G dm dn          Z`do e`ja        D             Zb eN eR eTe`ebp          dq ebD             p          dr ebD             p          Z` G ds dt          Zc eR eTec                    Zc G du dv          Zddw edja        D             Ze eR eTedeep          eep          Zd G dx dy          Zfdz efja        D             Zg eN eR eTefegp          egp          egp          Zf G d{ dW          Zhd| d}D             Zg eN eR eTehegp          egp          egp          Zhe%fdfd~Zi eIdd           G d d                      Zjd Zkd Z.dS )    )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dS )_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                    dS )NNOTHING selfs    Z/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/attr/_make.py__repr__z_Nothing.__repr__K   s    y    c                    dS )NFr   r   s    r!   __bool__z_Nothing.__bool__N   s    ur#   N)	__name__
__module____qualname____doc__enumautor   r"   r%   r   r#   r!   r   r   >   sK          dikkG      r#   r   c                  0    e Zd ZdZ ed          dfdZdS )_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__f   s     %''r#   )r&   r'   r(   r)   typer2   r   r#   r!   r-   r-   Z   sA        	 	 ,04::R ( ( ( ( ( (r#   r-   Tc                h   t          |||d          \  }}}}||dur|durd}t          |          |	I| 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*
    .. versionchanged:: 25.4.0
       *kw_only* can now be None, and its default is also changed from False to
       None.
    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   j   s   t $>R$ $ By D,,U1B1BFnn'!!O  S//!   	">CS//!'"" *tUm,, /\:.
 %Z	D%=99 %)$	 %Z	D%=99 %)$	   ) T D	
 T T )  T  2 v e ) :  e! r#    scriptstrglobsdict[str, Any] | NonelocsMapping[str, object] | NonefilenamereturnNonec                J    t          | |d          }t          |||           dS )z[
    Evaluate the script with the given global (globs) and local (locs)
    variables.
    execN)compileeval)rT   rV   rX   rZ   bytecodes        r!   _compile_and_evalrb      s-     vx00H5$r#   localsdict[str, Any]c                   |i n|}d}|}	 t          |           d|                     d          |f}t          j                            ||          }||k    rn|dd          d| d}|dz  }ct          | |||           |S )zP
    Cache the script with _linecache_, compile it and return the _locals_.
    Nr
   T->)len
splitlines	linecachecache
setdefaultrb   )	rT   rZ   rV   rc   rX   countbase_filenamelinecache_tupleold_vals	            r!   _linecache_and_compilerr      s     22VD EMKKd##	
 /,,XGGo%%#CRC(335333
 feT8444Kr#   cls_name
attr_names	list[str]r3   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   )rs   rt   attr_class_namebodyry   	attr_namerz   s          r!   _make_attr_tuple_classr   	  sr     "---OD!*-- + +9 	 	 	 	 #6**Y%4000r#   c                  .    e Zd ZU ded<   ded<   ded<   dS )_Attributesr3   attrslist[Attribute]
base_attrsdict[str, type]base_attrs_mapN)r&   r'   r(   __annotations__r   r#   r!   r   r      s3         KKK######r#   r   c                    t          |           } |                     d          r|                     d          r
| dd         } |                     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
   rf   )rU   
startswithendswith_CLASSVAR_PREFIXES)annots    r!   _is_class_varr   &  s\     JJE 
## z(B(B ad.///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   7  s     #,&&r#   'tuple[list[Attribute], dict[str, type]]c                   g }i }t          | j        dd                   D ]\}t          |dg           D ]H}|j        s	|j        |v r|                    d          }|                    |           |||j        <   I]g }t                      }t          |          D ]<}|j        |v r|                    d|           |	                    |j                   =||fS )zQ
    Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
    r
   rf   __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9 	- 	-A{ af(8884((Aa   $,M!&!!	- H55Dj!!  6T>>1]""r#   c                   g }i }| j         dd         D ]o}t          |dg           D ][}|j        |v r|                    d          }|                    |j                   |                    |           |||j        <   \p||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
   rf   r   Tr   )r   r   r   r   r   r   )r   r   r   r   r   r   s         r!   _collect_base_attrs_brokenr   _  s     JM K"% - -#4b99 	- 	-Av)))4((A  (((a   $,M!&!!	- }$$r#   c           
        | j         t          |           |#t          |                                          }n0|du rd                                 D             }g }t	                      }                                D ]y\  }	}
t          |
          r|                    |	                               |	t                    }|j	        t          urt          |          }|                    |	|f           z||z
  }|r:t          dd                    t          |fd                    z   dz             n.t          d	                                 D             d
           }t           j        t$          j        j        fd|D             }|rt+          | d |D                       \  }}nt-          | d |D                       \  }}t$          j        j        u rd |D             }d |D             }||z   }|t1           || |                    }d}d |D             D ]<}|du r"|j        t          u rd|}t5          |          |du r|j        t          urd}=|D ]>}|j        s5t9                              |          dt=          |j                             ?d |D             }tA          | j!        |          }tE           ||          ||          S )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`.
    NTc                4    h | ]\  }}|j         t          u |S r   	__class__rO   .0r   attrs      r!   	<setcomp>z#_transform_attrs.<locals>.<setcomp>  s3     
 
 
d~.. ...r#   z1The following `attr.ib`s lack a type annotation: , c                8                         |           j        S r/   )getcounter)ncds    r!   <lambda>z"_transform_attrs.<locals>.<lambda>  s    bffQii6G r#   )key.c              3  @   K   | ]\  }}|j         t          u ||fV  d S r/   r   r   s      r!   	<genexpr>z#_transform_attrs.<locals>.<genexpr>  sC        D$>]22 t2222 r#   c                    | d         j         S Nr
   )r   )es    r!   r   z"_transform_attrs.<locals>.<lambda>  s    !A$, r#   c           
     \    g | ](\  }} ||u                     |                    )S r   )r   )r   r   caannsfcar>   nos      r!   
<listcomp>z$_transform_attrs.<locals>.<listcomp>  sX        Ir 	2HHY		
 	
  r#   c                    h | ]	}|j         
S r   r   r   r   s     r!   r   z#_transform_attrs.<locals>.<setcomp>      ,,,Q!&,,,r#   c                    h | ]	}|j         
S r   r   r   s     r!   r   z#_transform_attrs.<locals>.<setcomp>  r   r#   c                :    g | ]}|                     d           S T)r>   r   r   s     r!   r   z$_transform_attrs.<locals>.<listcomp>  s&    ???QXXdX++???r#   c                :    g | ]}|                     d           S r   r   r   s     r!   r   z$_transform_attrs.<locals>.<listcomp>  s&    AAAahhth,,AAAr#   Fc              3  >   K   | ]}|j         d u|j        d u |V  dS )FN)r;   r>   r   s     r!   r   z#_transform_attrs.<locals>.<genexpr>  s:      MMA!&"5"5!)u:L:La:L:L:L:LMMr#   zlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: rD   c                    g | ]	}|j         
S r   r   r   s     r!   r   z$_transform_attrs.<locals>.<listcomp>  s    (((Q!&(((r#   )#r   r   rK   itemsr   r   r   r   r   r   rO   rR   r   r   joinsorted	Attributefrom_counting_attr
ClassPropsKeywordOnlyNOr   r   FORCErL   r6   rG   rD   _OBJ_SETATTR__get___default_init_alias_forr   r   r&   r   )r   theseauto_attribsr>   collect_by_mrofield_transformerca_listca_namesannot_namesr   r3   r   unannotated	own_attrsr   r   r   had_defaultrQ   rt   
AttrsClassr   r   r   r   s      `                 @@@@r!   _transform_attrsr   {  s   $ 
BC  Du{{}}%%			
 
 hhjj
 
 

 ee#zz|| 	+ 	+OItT"" OOI&&&y'**A{-//1IINNIq>****, 	+C));,G,G,G,GHHH  	  	  "$((**  
 '&
 
 
 
&C			"B       %  I  
$7,,),,,%
 %
!
MM %?,,),,,%
 %
!
M *(...??Y???	AAjAAA
"E$''U3344 KMMMMM  $19#7#7 G  BC  G  GCS//!%AIW$<$<K
  N Nw 	N  ##G-DQV-L-LMMM )(%(((J'jAAJzz%((*mDDDr#   c                2   g d}||                     d           n|                    g d           |                    ddg           t          |d          }| t          j        |d}t          d                    |          ||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)rc   __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, D "		%/4   r#   c                ~    t          | t                    r"|dv rt                              | ||           dS 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  '  sL     $&& 4 4 , , 	!!$e444
r#   c                |    t          | t                    r!|dv rt                              | |           dS t          )z4
    Attached to frozen classes as __delattr__.
    )r   N)rJ   r   __delattr__r   )r    r   s     r!   _frozen_delattrsr  8  sA     $&& 4>+A+A!!$---
r#   c                    	 | \  }n1# t           $ r$ dt          |            d}t          |          dw xY w|j        }t	          |          }|D ]/}|j        s
|j        }|j        }||vrt          ||          ||<   0 |di |S )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   ri   rF   r   fieldsr;   r   rD   r   )	argschangesinstrQ   r   r   r   r   	init_names	            r!   r   r   C  s    J' ' ' 'OTOOO 	 nn$&	' .C3KKE : :v 	F	G	G##!(y!9!9GI3>>>>s    .5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d"S )&_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_setattrr   r3   r   boolpropsr   has_custom_setattrc                   t          ||||j        |j        |j                  \  }}}|| _        |j        rt          |j                  ni | _        || _	        d |D             | _
        || _        t          d |D                       | _        |j        | _        |j        | _        |j        | _        |j        t(          j        j        u | _        t1          t3          |dd                    | _        d| _        | j        r8|j        }	t;          j        |	          }
t?          |
j                   dk    | _        t1          t3          |dd                    | _!        t1          |           | _"        |j#        | _$        |j%        | _&        || _'        d| _(        | j	        | j        d<   || j        d<   |j        r&tR          | j        d	<   tT          | j        d
<   d| _(        n| j&        tV          tX          j-        tX          j.        fv rjdx}}|D ]}|j/        d}|j0        d}|r|r n| j&        tV          k    r|s|r.| j&        tX          j-        k    r|r| j&        tX          j.        k    r	|sd | _&        |j1        r'| 2                                \  | j        d<   | j        d<   g | _3        d| _4        tk          | j        d          rtk          | j        d          s| j6        | _7        d S | j8        | _7        d S )Nc                    h | ]	}|j         
S r   r   r   s     r!   r   z)_ClassBuilder.__init__.<locals>.<setcomp>  s    777qAF777r#   c              3  $   K   | ]}|j         V  d S r/   r   r   s     r!   r   z)_ClassBuilder.__init__.<locals>.<genexpr>  s$       7 7A 7 7 7 7 7 7r#   __attrs_pre_init__Fr
   __attrs_post_init__r   __attrs_props__r   r  T__getstate____setstate__r'   r(   )9r   r>   collected_fields_by_mror   r   
is_slotteddictr   r  r  r  r  rL   r  r   	is_frozenr  has_weakref_slotr!  hashabilityr   HashabilityHASHABLE_CACHEDr  r#  r   r  r  r)  inspect	signatureri   
parametersr  r  is_exceptionr  on_setattr_hookr  r  r"  r  r  _DEFAULT_ON_SETATTRr   validateconvertr7   r<   added_pickling_make_getstate_setstater  r  hasattr_add_method_dunders_safer  _add_method_dunders_unsafe)r    r   r   r   r$  r%  r   r   base_mappre_init_funcpre_init_signaturehas_validatorhas_converterr   s                 r!   __init__z_ClassBuilder.__init__  s=    '7M)#'
 '
#z8 	/4/?Gcl+++R77J777&  7 7 7 7 777&"3!7!GG 	 "'#/CU"K"KLL"' 	M  2M!(!2=!A!A&)*<*G&H&H1&LD#"730Eu#M#MNN#';;) 0#5 "',0K(),1()? 	(,<DN=),<DN=)&*D##O"
 
 

 -21MM  ;*$(M;*$(M  ] E $(;;;* <.; < $(8888$777
 $(  	/ ,,..~.~.  	 ! ty,// 	GwI~8
 8
 	G (,'DD$$$'+'FD$$$r#   c                "    d| j         j         dS )Nz<_ClassBuilder(cls=z)>)r   r&   r   s    r!   r"   z_ClassBuilder.__repr__  s    ;TY%7;;;;r#   r[   r\   c                   d                     d | j        D                       }i }| j        D ]\  }}}|                    |           t          |t	          | j        d          |          }| j        D ]\  }}} || j        |           dS )z=
        Evaluate any registered snippets in one go.
        r   c                    g | ]
}|d          S )r   r   )r   snippets     r!   r   z0_ClassBuilder._eval_snippets.<locals>.<listcomp>  s    LLL7GAJLLLr#   methodsN)r   r  updaterr   r   r   r  )r    rT   rV   _snippet_globsrX   hooks          r!   _eval_snippetsz_ClassBuilder._eval_snippets  s     LLd6KLLLMM#'#8 	( 	(A}aLL''''%%di;;
 
 / 	' 	'JAq$D&&&&	' 	'r#   c                `   |                                   | j        du r3|                                 }t          j        |          | j        _        n/|                                 }t          rt          j
        |          }t          |dd          rd|j        vr|                                 |S )z
        Finalize class based on the accumulated configuration.

        Builder cannot be used after calling this method.
        T__attrs_init_subclass__N)rR  r   _create_slots_classweakrefrefr   __attrs_base_of_slotted___patch_original_classr   abcupdate_abstractmethodsr   r   rT  )r    r   s     r!   build_classz_ClassBuilder.build_class  s     	;$**,,C29+c2B2BDI//,,..C 6055
 C2D99	*)=='')))
r#   c                   | j         }| j        }| j        rl| j        D ]d}||vr^t	          ||t
                    t
          urAt          j        t                    5  t          ||           ddd           n# 1 swxY w Y   e| j
                                        D ]\  }}t          |||           | j        s+t	          |dd          rd|_        | j        st           |_        |S )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"  r^  r  r   r   )r    r   
base_namesr   r  s        r!   rY  z#_ClassBuilder._patch_original_class-  sL    i%
  
	+( 	+ 	+
**T955YFF
 $,^<< + +T***+ + + + + + + + + + + + + + +  >//11 	& 	&KD%Cu%%%% & 	/7(%,
 ,
 	/ ).C%+ /".
s   A66A:	=A:	c           	          fd j                                         D             }t          t          d          rt          j         j                    j        sBd|d<    j        s6 j        j        D ])j	        
                    dd          rt          |d<    n*i }d} j        j        dd         D ]Oj	        
                    dd	          d
}|                    fdt          dg           D                        Pt           j                   j        } j        r#dt           j        dd          vrd|vr|s|dz  }d |                                D             }g }|rt'           j                  }|                                D ]T\  }}	||fz  }||= |                    |	           t+          j        |	          j        }
|
t*          j        j        ur|
||<   U|
                    d          }||                    |           t5          || j                  |d<   fd|D             fd|                                D             fdD             |                                j        r                    t8                     t;                    |d<    j        j        |d<    t?           j                   j        j          j        j        |          }tC          j"        |j	        #                                |          D ]}tI          |tJ          tL          f          rt          |j'        dd	          }n=tI          |tP                    rt          |j)        dd	          }nt          |dd	          }|su|D ]*}	 |j*         j        u }|r||_*        # tV          $ r Y 'w xY w|S )zL
        Build and return a new class with a `__slots__` attribute.
        c                V    i | ]%\  }}|g t          j                  d dR v"||&S )r   __weakref__)rL   r  )r   kvr    s      r!   
<dictcomp>z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>U  sR     
 
 
1M% 011M:M}MMMM qMMMr#   _clear_type_descriptorsFr^  r   r
   rf   rh  NTc                2    i | ]}|t          |          S r   r   )r   r   r   s     r!   rk  z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>x  s5        '(D11  r#   	__slots__r   )rh  c                N    i | ]"\  }}t          |t                    ||j        #S r   )rJ   r   func)r   r   cached_props      r!   rk  z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>  sA     
 
 
!k+77
+"
 
 
r#   r   c                    g | ]}|v|	S r   r   )r   r   re  s     r!   r   z5_ClassBuilder._create_slots_class.<locals>.<listcomp>  s#    GGGtJ0F0Fd0F0F0Fr#   c                $    i | ]\  }}|v 	||S r   r   )r   slotslot_descriptor
slot_namess      r!   rk  z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>  s4     
 
 
%oz!! /!!!r#   c                    g | ]}|v|	S r   r   )r   r   reused_slotss     r!   r   z5_ClassBuilder._create_slots_class.<locals>.<listcomp>  s#    NNNtT5M5Md5M5M5Mr#   r(   __closure__),r  r   r@  sysrl  r   r"  r  	__bases__r   r   r   r   rN  r   r   r  r  r!  r   r   r6  r7  return_annotation	Parameteremptyr   r  _HASH_CACHE_FIELDrL   r(   r3   r&   	itertoolschainvaluesrJ   classmethodstaticmethod__func__r|   fgetcell_contentsrG   )r    r   existing_slotsweakref_inheritednamesr   &additional_closure_functions_to_updateclass_annotationsr   rq  
annotationr   r   itemclosure_cellscellmatchr   re  ry  rw  s   `                @@@@r!   rU  z!_ClassBuilder._create_slots_classQ  s   
 
 
 
,,..
 
 
 3122 	3'	222 & 	*/B&'+  $	 3  H(,,-DeLL ,8=) !	)!B$/ 	 	H $$]D99E$(!!!    '+r B B      )**
 	&WTYR%H%HHHU**% + %%E
 
%'XXZZ
 
 
 24. 	 0 ; ;/5577 9 9
d$ tH6==dCCC$.t44F
W%6%<<<.8%d+!vvm44+6==>NOOO =!#3TY! !B} HGGGuGGG

 
 
 
)7)=)=)?)?
 
 

 ONNNzNNN

		, 	1/000
++;!Y3> d49oodi0$)2ErJJ OL!!#I
 
 	1 	1D $l ;<< 	C !(}d K KD(++ C !(	=$ G G 'mT B B  % 1 11 .$);E
  1-0* "   D1 
s   N77
OOc                     t           j        |          \  }} fd} j                            |||f           d _         S )Nc                D                         |d                   | d<   d S )Nr"   r  cls_dictrV   r    s     r!   _attach_reprz,_ClassBuilder.add_repr.<locals>._attach_repr  s&    #'#;#;E*<M#N#NHZ   r#   T)_make_repr_scriptr  r  r   r  )r    nsrT   rV   r  s   `    r!   add_reprz_ClassBuilder.add_repr  sc    )$+r::	O 	O 	O 	O 	O 	$$fe\%BCCCr#   c                v    | j         sd}t          |          d }|                     |          | j        d<   | S )Nz3__str__ can only be generated if a __repr__ exists.c                *    |                                  S r/   r"   r   s    r!   __str__z&_ClassBuilder.add_str.<locals>.__str__  s    ==??"r#   r  )r  rG   r  r  )r    rQ   r  s      r!   add_strz_ClassBuilder.add_str  sN     	"GCS//!	# 	# 	# %)$<$<W$E$Ey!r#   c                n    t          d | j        D                       fd}| j        fd}||fS )zF
        Create custom __setstate__ and __getstate__ methods.
        c              3  &   K   | ]}|d k    |V  dS )rh  Nr   )r   ans     r!   r   z8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>  s5       !
 !
R=-@-@B-@-@-@-@!
 !
r#   c                "      fdD             S )9
            Automatically created by attrs.
            c                2    i | ]}|t          |          S r   rn  r   r   r    s     r!   rk  zQ_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate.<locals>.<dictcomp>  s%    KKK$D'$--KKKr#   r   )r    state_attr_namess   `r!   slots_getstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate  s"     LKKK:JKKKKr#   c                   t                               |           }t          |t                    r#t	          |          D ]\  }} |||           nD ]}||v r ||||                    r |t
          d           dS dS )r  N)r   r   rJ   rL   zipr  )r    state_ClassBuilder__bound_setattrr   r  hash_caching_enabledr  s        r!   slots_setstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstate  s     +22488O%'' ; $''7#?#? 1 1KD%#OD%00001 - ; ;Du}}'eDk::: $ 9 14888889 9r#   )rL   r  r  )r    r  r  r  r  s      @@r!   r?  z%_ClassBuilder._make_getstate_setstate  s    
 ! !
 !
)!
 !
 !
 
 
	L 	L 	L 	L 	L  $/	9 	9 	9 	9 	9 	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                            |||f            S )	Nfrozen
cache_hashr  r0  rX   r[   r\   c                D                         |d                   | d<   d S r  r  )r  rX   r    s     r!   attach_hashz+_ClassBuilder.add_hash.<locals>.attach_hash*  s&    #'#;#;D<L#M#MHZ   r#   )r  r0  rX   r0  r[   r\   )_make_hash_scriptr   r  r  r  r  r   )r    rT   rV   r  s   `   r!   add_hashz_ClassBuilder.add_hash"  sy    )IK<'	
 
 
	N 	N 	N 	N 	N 	N 	$$fe[%ABBBr#   c                     t           j         j         j         j         j         j         j         j         j	         j
         j        d          \  }} fd} j                            |||f            S )NF
attrs_initc                V    |d         }|_                             |          | d<   d S )NrH  r   r  r  rV   r;   r   r    s      r!   _attach_initz,_ClassBuilder.add_init.<locals>._attach_initA  s3    $D#.D #'#;#;D#A#AHZ   r#   _make_init_scriptr   r  r  r  r  r  r   r  r  r  r  r  r   )r    rT   rV   r  r   s   `   @r!   add_initz_ClassBuilder.add_init1  s    %6IK#LKL&
 &
 &
"{	B 	B 	B 	B 	B 	B
 	$$fe\%BCCCr#   c                B    |                      d           | j        d<   | S )Nc                    t          | fi |S r/   r   )r    r
  s     r!   r   z+_ClassBuilder.add_replace.<locals>.<lambda>L  s    F4$;$;7$;$; r#   __replace__)r  r  r   s    r!   add_replacez_ClassBuilder.add_replaceJ  s+    (,(@(@;;)
 )
}% r#   c                R    t          d | j        D                       | j        d<   d S )Nc              3  @   K   | ]}|j         	|j        |j        V  d S r/   )r;   r>   r   )r   fields     r!   r   z/_ClassBuilder.add_match_args.<locals>.<genexpr>Q  sL       1
 1
z1
 #(-1
J1
 1
 1
 1
 1
 1
r#   __match_args__)rL   r  r  r   s    r!   add_match_argsz_ClassBuilder.add_match_argsP  s=    +0 1
 1
1
 1
 1
 ,
 ,
'(((r#   c                     t           j         j         j         j         j         j         j         j         j	         j
         j        d          \  }} fd} j                            |||f            S )NTr  c                V    |d         }|_                             |          | d<   d S )N__attrs_init__r  r  s      r!   _attach_attrs_initz8_ClassBuilder.add_attrs_init.<locals>._attach_attrs_initg  s5    )*D#.D )-)A)A$)G)GH%&&&r#   r  )r    rT   rV   r  r   s   `   @r!   add_attrs_initz_ClassBuilder.add_attrs_initW  s    %6IK#LKL&
 &
 &
"{	H 	H 	H 	H 	H 	H
 	$$fe5G%HIIIr#   c                      j         }t           j                  \  }} fd} j                            |||f           t
          |d<    S )Nc                D                         |d                   | d<   d S )N__eq__r  r  s     r!   
_attach_eqz(_ClassBuilder.add_eq.<locals>._attach_equ  s%    !%!9!9%/!J!JHXr#   __ne__)r  _make_eq_scriptr  r  r   r  )r    r   rT   rV   r  s   `    r!   add_eqz_ClassBuilder.add_eqp  si    ^'44	K 	K 	K 	K 	K 	$$feZ%@AAA8r#   c                      j         } fdt           j         j                  D             \  |d<   |d<   |d<   |d<    S )Nc              3  B   K   | ]}                     |          V  d S r/   r  )r   methr    s     r!   r   z*_ClassBuilder.add_order.<locals>.<genexpr>  sM       B
 B
 $$T**B
 B
 B
 B
 B
 B
r#   __lt____le____gt____ge__)r  _make_orderr   r  )r    r   s   ` r!   	add_orderz_ClassBuilder.add_order~  sg    ^B
 B
 B
 B
#DIt{;;B
 B
 B
>8blBxL"X,
 r#   c                   i | j         D ],}|j        p| j        }|r|t          j        ur||f|j        <   -s| S | j        rd}t          |          fd}d| j        d<   | 	                    |          | j        d<   d| _
        | S )Nz7Can't combine custom __setattr__ with on_setattr hooks.c                    	 |         \  }} || ||          }n# t           $ r |}Y nw xY wt          | ||           d S r/   )KeyErrorr   )r    r   valr   rQ  nvalsa_attrss         r!   r   z._ClassBuilder.add_setattr.<locals>.__setattr__  sl    *"4.4 tD!S))    
 tT*****s    ++Tr^  r   )r  rC   r  r   NO_OPr   r  rG   r  r  r"  )r    r   rC   rQ   r   r  s        @r!   add_setattrz_ClassBuilder.add_setattr  s     	1 	1A9)9J 1j==#$j=  	K# 	"KCS//!	+ 	+ 	+ 	+ 	+ 37./(,(@(@(M(M}%"&r#   methodr   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    r  s     r!   rB  z(_ClassBuilder._add_method_dunders_unsafe  sR     !I0!%!7KK&/KK M493ILLL 	 r#   c                   t          j        t                    5  | j        j        |_        ddd           n# 1 swxY w Y   t          j        t                    5  | j        j         d|j         |_        ddd           n# 1 swxY w Y   t          j        t                    5  d| j        j         d|_        ddd           n# 1 swxY w Y   |S )zL
        Add __module__ and __qualname__ to a *method* if possible.
        Nr   r  )r`  ra  rb  r   r'   r(   r&   r)   r  s     r!   rA  z&_ClassBuilder._add_method_dunders_safe  s     00 	5 	5 $	 4F	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5  00 	P 	P%)Y%;"O"Ofo"O"OF	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P  00 	^ 	^]DIDZ]]]FN	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ s0   8<<BBB(C

CCN)r   r3   r   r#  r$  r   r%  r#  )r[   r\   )r  r   r[   r   )r&   r'   r(   r)   ro  rH  r"   rR  r\  rY  rU  r  r  r?  r  r  r  r  r  r  r  r  r  rB  rA  r   r#   r!   r  r  }  su        I0cG cG cG cGJ< < <' ' ' '$  2" " "HM M M^  	 	 	'. '. '.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    s    
 3$T0ABCC6oo Cx 
z}	U{{u}}=oo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                6    t          |           rd| }} n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  s,     E?? 	u3EECczr#   FTr  r  )	r9   r?   rA   r  rQ   r  cmp_keyr@   rB   s	            r!   rE   rE     s    
 3$T0ABCC6oo   11#66WGS')) 
zF//33
F}vy55e<<y	U{{u}}=oovui''r#   c                Z    |du s|du r|S ||du r|S |D ]}t          | |          r dS |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    sd     t||tu}}|u,,   c6** 	55	 Nr#   Fc                Z  	
 (ddl }|                    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*.
    .. versionchanged:: 25.4.0
       *kw_only* now only applies to attributes defined in the current class,
       and respects attribute-level ``kw_only=False`` settings.
    .. versionadded:: 25.4.0 *force_kw_only*
    Nr   zQThe `repr_ns` argument is deprecated and will be removed in or after August 2025.   )
stacklevelc                |   pt          |           }du ot          | t                    }ot          | d          }|r|rd}t	          |          | ot          | d          }t          j        }|r|j        }n}du rr|j	        n|j
        }nhdu r|j        }n\Idu rt          | d          r|j        }n>|du r|du rr|j	        n|j
        }n%|du r|j        }n|j        }nd}t          |          t          j        }rr|j        n|j        }	n|j        }	t          d"i d|d	|d
ddt          | d          dt          | d          d|d| ot          | d          d|dd|	d!ddt          | d          dd}
|
j        srd}t          |          t%          |  |
|          }|
j        r|                               |
j        r|                                 |
j        r|                                 |
j        r|                                 s|                                 |
j        r|                                 n"|
j        |j        u r|                                 |
j        r|                                  n'|!                                 rd}t          |          tD          r$t          | d           s|#                                 tH          r&r$t          | d!          s|%                                 |&                                S )#NTr   z/Can't freeze a class with a custom __setattr__.)r  r  Fr  r5   r9  r1  r/  r.  
added_initrH  
added_reprr  added_eqadded_ordering)r  r  r  r  r3  added_match_argsr>   r2  	added_strr>  )r,  r-  )r6   r:  r   zlInvalid value for cache_hash.  To use hash caching, hashing must be either explicitly or implicitly enabled.)r   r$  r%  zFInvalid value for cache_hash.  To use hash caching, init must be True.r  r  r   )'_has_frozen_base_class
issubclassr   r   rG   r  r   r4  LEAVE_ALONEr5  HASHABLE
UNHASHABLErF   r   r   YESr   is_hashabler  r	  r  r  r  r
  r  r  r  r  r  r3  r  r  r  r  r   r  r   r  r\  )"r   r1  is_exchas_own_setattrrQ   r?   r4  r3  r   kwor$  builderr   r  auto_excr  r   eq_r   force_kw_onlyr  getstate_setstater:   r;   r>   
match_argsrC   order_r8   repr_nsslotsrU   r   weakref_slots"               r!   wrapzattrs.<locals>.wrap  s   94S99	T!Djm&D&D% 
*<+
 +
  	"y 	"CCS//!Z 
;k#7
 
 !, 	!%1KKT\\ *++ ) K
 U]]%1KK\d""'9#z'J'J")5t	T 1 1 ".K//$- 
 u)5)4JCC..  , 	!'4I+##+/CC.C !
 !
 !
!
i!
 u!
 %3N	!

 7T;  !
 7T;  !
 R!
  &: /8	 !
& $'!
( (Z)!
* C+!
, *\-!
. c/!
0 ;!0   1!
> 'J?!
@ 0/A!
F   	!Z 	! ACC.. %.
 
 
  	&W%%%? 	OO> 	NN 	  	"!!! 	&+"888##%%% 	%""$$$ %^nn$ 	" 23 F F 	"!!! 	%	% 's,<==	%
 ""$$$""$$$r#   )	warningswarnDeprecationWarningr  rJ   rK   rL   r   rM   )	maybe_clsr   r  r8   r9   r:   r;   r   r  r!  rU   r   r>   r  r  r?   rA   r  r   r  rC   r   r  unsafe_hashr  r#  r"  r  r  s    ``` ``````````  `````` `  @@r!   r   r   '  sZ   B c  	 	 	
 	
 	
 ,CUDAAKC *tUm,, /\:.
G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G% G%V 4	??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  3  s    
 ?...r#   r   	func_namec           
     L    d| d| j          dt          | d| j                   dS )zF
    Create a "filename" suitable for a function being generated.
    z<attrs generated  r   r(   rh   )r'   r   r&   )r   r)  s     r!   r   r   ;  sF    
	9I 	9 	9 	9 	9355	9 	9 	9r#   r   r   r  r#  r  tuple[str, dict]c                N  	
 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}|r                    |dt           dz              |r4 |dt           d|dz                                 |dz  dz              n |dt           d|dz                                 |dt           z              n |d|           d                              }|	fS )Nc              3  L   K   | ]}|j         d u s|j         |j        d u |V   dS )TN)r:   r?   r   s     r!   r   z$_make_hash_script.<locals>.<genexpr>H  sA        AFdNNqv~!$$,,,,,, r#           r:   zdef __hash__(selfzhash((z))z):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper()c           	     T                        || z   z   |d	 dz   g           D ]d}|j        r:d|j         d}|j        |<                       |d| d|j         dz              C                    |d|j         dz              e                    |dz   z              d	S )
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/  ,rO  _key(self.z),        self.    N)r   r@   r   r   )
prefixindentr   cmp_namer   closing_bracesrV   	hash_funcmethod_lines	type_hashs
       r!   append_hash_computation_linesz8_make_hash_script.<locals>.append_hash_computation_lines`  s    	)+0I0000	
 	
 	
  	H 	HAx H+qv+++"#(h##BBBBBBB    ##F-FQV-F-F-F$FGGGGFVOn<=====r#   zif self.z	 is None:zobject.__setattr__(self, '', r  self. = zreturn self.zreturn r   )rL   r:   r   r   r  r   )r   r   r  r  tabhash_defr>  rT   r:  rV   r;  r<  r=  s    `      @@@@@r!   r  r  E  s          E C.sF;;<<IE"HIN DEYY%	1	#:L> > > > > > > > > >4  6C"I->"I"I"IIJJJ 	))C->CCCS1W   a#....)).)...a   	C"D1B"D"DDEEEE%%i555YY|$$F5=r#   c                    t          | |dd          \  }}t          ||t          | d                     |d         | _        | S )z%
    Add a hash method to *cls*.
    Fr  r  rZ   )r  rb   r   r  r   r   rT   rV   s       r!   	_add_hashrG    sc     &U5U  MFE  9#z J J    $CLJr#   c                R    |                      |          }|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    s.    
 [[F:r#   rK   c                   d | D             } g d}i }| r|                     d           | D ]}|j        rBd|j         d}|j        ||<   |                     d| d|j         d| d	|j         d
	           n%|                     d|j         d|j                    || d         ur|d          d|d<   |                     d           n|                     d           d                    |          }||fS )z6
    Create __eq__ method for *cls* with *attrs*.
    c                     g | ]}|j         	|S r   )r?   r   s     r!   r   z#_make_eq_script.<locals>.<listcomp>  s    &&&1&Q&&&r#   )zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz    return  (rO  r3  r/  r4  z) == z(other.r0  r5  z
 == other.rf   z andz    )z    return Truer   )r   r@   r   r   )r   r   rV   r   r9  rT   s         r!   r  r    sY    '&&&&E  E E (_%%% 	/ 	/Ax 	I+qv+++ #$(hVxVVqvVVHVVQVVVV    GQVGGqvGGHHHb	!!$Ry...b	W&'''YYuF5=r#   c                \    d D             fdfd}fd}fd}fd}||||fS )z9
    Create ordering methods for *cls* with *attrs*.
    c                     g | ]}|j         	|S r   )rA   r   s     r!   r   z_make_order.<locals>.<listcomp>  s    )))1)Q)))r#   c                P     t          d  fdD             D                       S )z&
        Save us some typing.
        c              3  :   K   | ]\  }}|r ||          n|V  d S r/   r   )r   r  r   s      r!   r   z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>  sK       
 
s (CCJJJ5
 
 
 
 
 
r#   c              3  P   K   | ] }t          |j                  |j        fV  !d S r/   )r   r   rB   )r   r   objs     r!   r   z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>  sG        89af%%q{3     r#   )rL   )rS  r   s   `r!   attrs_to_tuplez#_make_order.<locals>.attrs_to_tuple  sW      
 
   =B  
 
 
 
 
 	
r#   c                ^    |j         | j         u r |            |          k     S t          S z1
        Automatically created by attrs.
        r   rI  r    rJ  rT  s     r!   r  z_make_order.<locals>.__lt__  9     ?dn,,!>$''..*?*???r#   c                ^    |j         | j         u r |            |          k    S t          S rV  rW  rX  s     r!   r  z_make_order.<locals>.__le__  9     ?dn,,!>$''>>%+@+@@@r#   c                ^    |j         | j         u r |            |          k    S t          S rV  rW  rX  s     r!   r  z_make_order.<locals>.__gt__  rY  r#   c                ^    |j         | j         u r |            |          k    S t          S rV  rW  rX  s     r!   r  z_make_order.<locals>.__ge__  r[  r#   r   )r   r   r  r  r  r  rT  s    `    @r!   r  r    s     *))))E	
 	
 	
 	
 	
                 666))r#   c                    || j         }t          |          \  }}t          ||t          | d                     |d         | _        t
          | _        | S )z5
    Add equality methods to *cls* with *attrs*.
    Nr  rE  )r   r  rb   r   r  r  rF  s       r!   _add_eqr_    sd     }##E**MFE 9#x H H    xCJCJJr#   c                   t          d | D                       }d |D             }t          |d<   t          |d<   t          |d<   g }|D ]H\  }}}|rd|z   nd|z   dz   }|t          k    r|d	|d
n
|d	|d|d}	|                    |	           Id                    |          }
|d}n|dz   }ddddddddddddd| d|
 ddd g}d!                    |          |fS )"zC
    Create the source and globs for a __repr__ and return it.
    c              3  p   K   | ]1}|j         d u|j        |j         du rt           n|j         |j        fV  2dS )FTN)r8   r   r;   r   s     r!   r   z$_make_repr_script.<locals>.<genexpr>  sV       " "6 
!&D..$$afqv>" "r#   c                8    i | ]\  }}}|t           k    |d z   |S )_repr)r8   )r   r   rrO  s       r!   rk  z%_make_repr_script.<locals>.<dictcomp>!  s0       (dAqQ$YYwYYYr#   r   rb  r   r@  zgetattr(self, "z", NOTHING)z={z!r}z_repr(z)}r   Nz1{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   r   rb  r   r8   r   r   )r   r  attr_names_with_reprsrV   attribute_fragmentsr   rd  ry   accessorfragmentrepr_fragmentcls_name_fragmentr   s                r!   r  r    s    " " "" " "  
 ,A  E E),E
E)+ 	- 	-
aMGdNN%6%=%M 	
 Dyy  44**'+ttTTT888< 	
 	""8,,,,II122M	zO!== 	D"+D--=)==M===.E$ 99UU""r#   c                    || j         }t          ||          \  }}t          ||t          | d                     |d         | _        | S )z%
    Add a repr method to *cls*.
    Nr"   rE  )r   r  rb   r   r"   )r   r  r   rT   rV   s        r!   	_add_reprrm  N  s`     }#%eR00MFE 9#z J J    $CLJr#   c                    t          |           }|&t          | t                    sd}t          |          t	          | dd          }|2|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$9.nnC*D11E}#L*;TBBE  ',#999"3'''Lr#   c                    t          | t                    sd}t          |          t          | dd          }|| d}t	          |          d |D             S )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
    ro  r   Nrp  c                    i | ]
}|j         |S r   r   r   s     r!   rk  zfields_dict.<locals>.<dictcomp>  s    %%%!AFA%%%r#   )rJ   r3   rF   r   r   )r   rQ   r   s      r!   fields_dictrt    sn    & c4   .nnC*D11E}999"3'''%%u%%%%r#   c           	         t           j        du rdS t          | j                  D ]+}|j        }|  || |t          | |j                             ,dS )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   rj  s      r!   r<  r<    sg     %''DN## . .K=AdAwtQV,,---. .r#   c                B    |                     |           }|od|j        v S )z>
    Check if the attribute name comes from a slot class.
    ro  )r   r   )a_namer   r   s      r!   _is_slot_attrry    s)     

F
#
#C.;#,..r#   tuple[str, dict, dict]c                n   |
d uo|
t           j        u}|r|rd}t          |          |p|}g }i }|D ]m}|j        s|j        t
          u r|                    |           |||j        <   |j        |du rd}t          |          d}V|r|j        t           j        urd}nt          |||||||||	|||rdnd          \  }}}| j
        t          j        v r/|                    t          j        | j
                 j                   |                    t
          |d           |rt          j        |d<   |||fS )Nz$Frozen classes can't use on_setattr.Tr  rH  )r   	attr_dictr   )r   r  rG   r;   r6   r   r   r   rC   _attrs_to_init_scriptr'   r{  modulesrN  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_attrsr|  r   rT   rV   r   s                        r!   r  r    s    	d"J~W]'J   $ 4oo%/NI ( (v 	!)w..a   	!&<#~~< oo%#'   	(AL$E$E#' !6&6J" "FE; ~$$S[09:::	LLW9==>>> < (4';#$5+%%r#   r   	value_varhas_on_setattrc                    d|  d| dS )zJ
    Use the cached object.setattr to set *attr_name* to *value_var*.
    
_setattr('r?  r0  r   )r   r  r  s      r!   _setattrr    s     3	22i2222r#   r<   	Converterc                <    d|  d|                     | |           dS )zk
    Use the cached object.setattr to set *attr_name* to *value_var*, but run
    its converter first.
    r  r?  r0  )_fmt_converter_callr   r  r  r<   s       r!   _setattr_with_converterr    s.     ]	\\i&C&CIy&Y&Y\\\\r#   r  c                8    |rt          | |d          S d|  d| S )zo
    Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
    relegate to _setattr.
    Tr@  rA  )r  )r   r  r  s      r!   _assignr    s4    
  0	5$///(9(((((r#   c                b    |rt          | |d|          S d|  d|                    | |           S )z
    Unless *attr_name* has an on_setattr hook, use normal assignment after
    conversion. Otherwise relegate to _setattr_with_converter.
    Tr@  rA  )r  r  r  s       r!   _assign_with_converterr  #  sG      N&y)T9MMMV9VV!>!>y)!T!TVVVr#   r   r   r   c                r    | du r$|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   r   rU   r  r  r#  r[   c                V    t          |           rt          | ||          S d|  d| S N_inst_dict['z'] = )ry  r  )r   r  r  r   s      r!   
fmt_setterz&_determine_setters.<locals>.fmt_setter@  s@     Y66 F	9nEEE=)==)===r#   r<   r  c                    |st          |           rt          | |||          S d|  d|                    | |           S r  )ry  r  r  )r   r  r  r<   r   s       r!   fmt_setter_with_converterz5_determine_setters.<locals>.fmt_setter_with_converterH  sd      y-!H!H .y.)   h)gg)2O2OPY[d2e2egggr#   )z_inst_dict = self.__dict__r   rU   r  rU   r  r#  r[   rU   
r   rU   r  rU   r  r#  r<   r  r[   rU   )r  r  r  r  )r  r   r   r  r  s     `  r!   _determine_settersr  0  s     ~~D==x!888	> 	> 	> 	> 	> 	>	h 	h 	h 	h 	h 	h ,%
 	
 w...r#   r1  r/  call_pre_initr  call_post_initdoes_cache_hashr  r  r  method_namec           
        |rdgng }|	r|                     d           t          |||          \  }}}|                    |           g }g }g }g }i }ddi}| D ]}|j        r|                     |           |j        }|j        dup|j        t          j        uo|
}|j        }t          |j
        t                    }|r|j
        j        rdnd}|j        /t          |j        t                    st          |j                  }n|j        }|j        du r|rt           |j        fz  }|K|                      |||d| d	z   ||                     |j        ||                    |j                  <   n'|                      |||d| d	z   |                     |j
        j        ||<   n]|I|                      ||d
| d||                     |j        ||                    |j                  <   n|                      ||d
| d|                     n|j
        t&          ur|s| d| d}|j        r|                     |           n*|                     |           |                     |           |E|                      |||||                     |j        ||                    |j                  <   nF|                      ||||                     n$|rt| d}|j        r|                     |           n*|                     |           |                     |           |                     d| d           t           |j        fz  }||                     d |||||          z              |                     d           |                     d |||dz   |z   d	z   ||          z              |j        ||                    |j                  <   nd|                     d ||||          z              |                     d           |                     d |||dz   |z   d	z   |          z              |j
        j        ||<   n|j        r|                     |           n*|                     |           |                     |           |D|                      |||||                     |j        ||                    |j                  <   n |                      ||||                     |j        du r(|j        ||j        ||<   ||j        r
|j        ||<   |rkt.          |d<   |                     d           |D ]I}d|j        z   }d|j        z   }|                     d| d| d|j         d	           |j        ||<   |||<   J|r|                     d           |r<|r|rdt0           d} ndt0           d} ndt0           d} |                     |            |r8d                     d! | D                       }!|                     d"|! d	           d#                    |          }d#                    |          }|rX||rd#nd d$d#                    |           z  }d#                    d% d& |D             D                       }"||rd#ndz  }||"z  }|r|r	d'| d	|d(<   d)}#d*| d| d+|r|#                    |          nd, d-||fS ).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    rS   Fre  r0  zattr_dict['z
'].defaultz=attr_dict['z=NOTHINGzif z is not NOTHING:r6  zelse:Tr   z#if _config._run_validators is True:__attr_validator___attr_z(self, z, self.zself.__attrs_post_init__()r  z', None)r  z	'] = Noner@  z = Noner2  c              3  8   K   | ]}|j         	d |j         V  dS )r@  N)r;   r   r   s     r!   r   z(_attrs_to_init_script.<locals>.<genexpr>E	  s4      BBQ16B(((BBBBBBr#   zBaseException.__init__(self, r   z*, c                    g | ]	}| d | 
S )=r   )r   kw_arg_names     r!   r   z)_attrs_to_init_script.<locals>.<listcomp>O	  s8          ....  r#   c              3  L   K   | ]}|                     d           d         V   dS )r  r   N)split)r   kwas     r!   r   z(_attrs_to_init_script.<locals>.<genexpr>R	  s1      #N#N#CIIcNN1$5#N#N#N#N#N#Nr#   zself.__attrs_pre_init__(r   z
    zdef z):
    passr   )r   r  r   r7   r   rC   r   r  rD   rJ   r6   rI   
takes_selfr<   r  r;   _INIT_FACTORY_PAT_get_global_namerP   r   r>   r3   _first_param_typer   r  r   )$r   r1  r/  r  r  r  r  r   r  r  r  r  r   extra_linesr  r  r	  pre_init_argskw_only_argsattrs_to_validatenames_for_globalsr   r   r   r  arg_namehas_factory
maybe_selfr<   init_factory_nameargval_nameinit_hash_cachevalspre_init_kw_only_argsNLs$                                       r!   r}  r}  _  sX	   ( .;B())E 
 3		
 	
 	
 :L:}: :6K6 
LLDML T"K XD XD; 	($$Q'''F	T1 
L-D2D 	
 7 G44*Kqy/CKVV
;":ak9+M+M"!!+..III6U?? *$5	$A!(LL11%-0AJ0A0A0AA*%	    "+ &i&@&@&H&HII LL"
%-0AJ0A0A0AA*    89y7H!"344&--!;i;;;&!	    ' ")"<"<QV"D"DEE J!;i;;;&     Yg%%k%@@9@@@Cy /##C((((C   $$X...$--!8^Y    ' ")"<"<QV"D"DEE ZZ	8^LLMMMM =	N'''Cy /##C((((C   $$X...LL9x999::: 1QVI =$//!8^Y    W%%%//!)C/*<sB&!	    ' ")"<"<QV"D"DEE ZZ	8^LLL   W%%% j!)C/*<sB&    4593D/00y /##H----H%%%$$X...$--!8^Y    ' ")"<"<QV"D"DEE ZZ	8^LLMMM6T>>v!i&7()H%%&9+F&(1(CH% -'.)$:;;;" 	- 	-A*QV3H!AF*ILLLLLLL16LLLMMM*++h'+,i(( 31222  & 	A N"J/@"J"J"J"M1B"M"M"M@&7@@@O_%%%  >xxBB%BBBBB<T<<<===99T??DIIm,,M /4'44REEDIIl,C,CEEE $		  $O#N#N#N#N  !
 !
 	6B6.. ?* ?>m>>>a 
B	 	 	T 	 	(RWWU^^^&	 	 	 	 r#   r   c                ,    |                      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.
    rO  )lstripr   s    r!   r   r   g	  s     ;;sr#   c                  l    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dS )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   NFc                X   t          ||p||p|d          \  }}}}t                              |           } |d|            |d|            |d|            |d|            |d|            |d|            |d|            |d	|            |d
|            |d|            |d|            |d|	r!t          j        t          |	                    nt                      |d|
            |d|            |d|            |d|            |d|           d S )NTr   r6   r7   r8   r?   r@   rA   rB   r:   r;   r<   r=   r3   r>   r   rC   rD   )rE   r   r   typesMappingProxyTyper0  _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!   rH  zAttribute.__init__	  s   * (B2y1E4(
 (
$FE9
 %,,T22 	fd###i)))k9---fd###dBh'''gu%%%k9---fd###fd###k9--- /&tH~~666.	
 	
 	
 	fd###i)))k9---lJ///gu%%%%%r#   c                    t           r/   )r   r  s      r!   r   zAttribute.__setattr__	  s    !!r#   r   rU   r   rO   r>   r#  c                $   ||j         }n|j         d| d}t          |           | ||j        |j        |j        d |j        |j        d|j        ||j        |j	        |n|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   r>   r3   rQ   s         r!   r   zAttribute.from_counting_attr	  s     <7DDW [SW[[[CS//!sKMGGGKLz)GGrzEIHLMH%
 
 	
r#   c                |    t          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
  s0     ioogmmoo&&&
r#   c                D     t           fd j        D                       S )(
        Play nice with pickle.
        c              3  l   K   | ].}|d k    rt          |          nt          j                  V  /dS )r=   N)r   r0  r=   r  s     r!   r   z)Attribute.__getstate__.<locals>.<genexpr>%
  sZ       
 
 $(:#5#5GD$4;N;N
 
 
 
 
 
r#   rL   ro  r   s   `r!   r,  zAttribute.__getstate__!
  s?      
 
 
 

 
 
 
 
 	
r#   c                V    |                      t          | j        |                     dS r  N)r  r  ro  r    r  s     r!   r-  zAttribute.__setstate__*
  s(     	s4>51122222r#   c           	         t                               |           }|D ]L\  }}|dk    r |||            |||r!t          j        t	          |                    nt
                     Md S )Nr=   )r   r   r  r  r0  r  )r    name_values_pairsr  r   r  s        r!   r  zAttribute._setattrs0
  s    $,,T22, 	 	KD%z!!dE**** !7.tE{{;;;6   		 	r#   )
NNNFNNNNNNr/   )r   rU   r   rO   r>   r#  )r&   r'   r(   r)   ro  rH  r   r  r   r   r,  r-  r  r   r#   r!   r   r   r	  s        ( (XI< '5& 5& 5& 5&n" " " ?C
 
 
 
 [
B  $
 
 
3 3 3    r#   r   c                n    g | ]2}t          |t          d dd dd|dk    ddt          |                    3S )NTFr=   r   r6   r7   r8   r9   r?   rA   r:   r;   r   rD   r   r   r   r   r   s     r!   r   r   @
  sg        	 j %d++    r#   )r   c                (    g | ]}|j         d k    |S r   r   r   s     r!   r   r   T
  s$    666Q+ 5 5q 5 5 5r#   c                6    g | ]}|j         	|j        d k    |S r   )r:   r   r   s     r!   r   r   V
  s+    
=
=
=AF
=qv'<'<1'<'<'<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	          R Zd
Zd Z	d Z
d ZdS )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              #  v   K   | ]4}t          |t          |          t          d dd ddddd dd dd           V  5d S )NTFr   rD   r6   r7   r8   r9   r:   r;   r>   r?   r@   rA   rB   r   rC   )r   r   r   r  s     r!   r   z_CountingAttr.<genexpr>v
  s|       
 
$ # -d33  
 
 
 
 
 
r#   )	r   r  r8   r?   rA   r:   r;   rC   rD   r=   NTFr  r   c                $   t           xj        dz  c_        t           j        | _        || _        || _        || _        || _        || _        || _        || _	        || _
        || _        || _        || _        |	| _        |
| _        || _        || _        d S 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!   rH  z_CountingAttr.__init__
  s    & 	!!Q&!!$0#"	
"		 	$


r#   c                X    | j         || _         n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
  s-     ?""DOO"4?D99DOr#   c                \    | 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)r  )r  r   r   rI   r  s     r!   r6   z_CountingAttr.default
  s0     =''((666r#   )r&   r'   r(   r)   ro  rL   r   r   r  rH  r7   r6   r   r#   r!   rO   rO   Z
  s         I$0	 
 
$
%
 
 
 

 

0> 			
 	
 	
?0 0Ob K# # #J      r#   rO   c                  ~    e Zd ZdZ G d dej                  Z G d dej                  ZdZd Z	e
d             Zd	S )
r   a  
    Effective class properties as derived from parameters to `attr.s()` or
    `define()` decorators.

    This is the same data structure that *attrs* uses internally to decide how
    to construct the final class.

    Warning:

        This feature is currently **experimental** and is not covered by our
        strict backwards-compatibility guarantees.


    Attributes:
        is_exception (bool):
            Whether the class is treated as an exception class.

        is_slotted (bool):
            Whether the class is `slotted <slotted classes>`.

        has_weakref_slot (bool):
            Whether the class has a slot for weak references.

        is_frozen (bool):
            Whether the class is frozen.

        kw_only (KeywordOnly):
            Whether / how the class enforces keyword-only arguments on the
            ``__init__`` method.

        collected_fields_by_mro (bool):
            Whether the class fields were collected by method resolution order.
            That is, correctly but unlike `dataclasses`.

        added_init (bool):
            Whether the class has an *attrs*-generated ``__init__`` method.

        added_repr (bool):
            Whether the class has an *attrs*-generated ``__repr__`` method.

        added_eq (bool):
            Whether the class has *attrs*-generated equality methods.

        added_ordering (bool):
            Whether the class has *attrs*-generated ordering methods.

        hashability (Hashability): How `hashable <hashing>` the class is.

        added_match_args (bool):
            Whether the class supports positional `match <match>` over its
            fields.

        added_str (bool):
            Whether the class has an *attrs*-generated ``__str__`` method.

        added_pickling (bool):
            Whether the class has *attrs*-generated ``__getstate__`` and
            ``__setstate__`` methods for `pickle`.

        on_setattr_hook (Callable[[Any, Attribute[Any], Any], Any] | None):
            The class's ``__setattr__`` hook.

        field_transformer (Callable[[Attribute[Any]], Attribute[Any]] | None):
            The class's `field transformers <transform-fields>`.

    .. versionadded:: 25.4.0
    c                  (    e Zd ZdZdZ	 dZ	 dZ	 dZdS )ClassProps.HashabilityzO
        The hashability of a class.

        .. versionadded:: 25.4.0
        hashablehashable_cache
unhashableleave_aloneN)r&   r'   r(   r)   r  r5  r  r  r   r#   r!   r4  r  6  s9        	 	 #*6!
+#''r#   r4  c                  "    e Zd ZdZdZ	 dZ	 dZdS )ClassProps.KeywordOnlyzw
        How attributes should be treated regarding keyword-only parameters.

        .. versionadded:: 25.4.0
        r   yesforceN)r&   r'   r(   r)   r   r  r   r   r#   r!   r   r  F  s1        	 	 .Q..r#   r   r9  r/  r2  r1  r>   r.  r  r	  r
  r  r3  r  r  r>  r:  r   c                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        || _        || _        || _        d S r/   r  )r    r9  r/  r2  r1  r>   r.  r  r	  r
  r  r3  r  r  r>  r:  r   s                    r!   rH  zClassProps.__init__g  s    & )$ 0"'>$$$ ,& 0",.!2r#   c                b    | j         t          j        j        u p| j         t          j        j        u S r/   )r3  r   r4  r  r5  r   s    r!   r  zClassProps.is_hashable  s1     
 6 ?? J:#9#II	
r#   N)r&   r'   r(   r)   r*   Enumr4  r   ro  rH  r|   r  r   r#   r!   r   r   
  s        B BH( ( ( ( (di ( ( ( / / / / /di / / /I&"3 "3 "3H 
 
 X
 
 
r#   r   c                f    g | ].}t          |t          d dd dddddt          |                    /S )NTFr  r  r  s     r!   r   r     sb        	 %d++    r#   c                  *    e Zd ZdZdZddZd Zd ZdS )	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   r  Fc                "    || _         || _        d S r/   r  )r    rP   r  s      r!   rH  zFactory.__init__  s    $r#   c                D     t           fd j        D                       S )r  c              3  8   K   | ]}t          |          V  d S r/   rn  r  s     r!   r   z'Factory.__getstate__.<locals>.<genexpr>  s-      DDTWT4((DDDDDDr#   r  r   s   `r!   r,  zFactory.__getstate__  s*     DDDDT^DDDDDDr#   c                ^    t          | j        |          D ]\  }}t          | ||           dS r  )r  ro  rd  )r    r  r   r  s       r!   r-  zFactory.__setstate__  sB     t~u55 	' 	'KD%D$&&&&	' 	'r#   N)F)r&   r'   r(   r)   ro  rH  r,  r-  r   r#   r!   rI   rI     sZ         $ *I% % % %E E E' ' ' ' 'r#   rI   c                J    g | ] }t          |t          d dd ddddd
  
        !S NTF)
r   r6   r7   r8   r9   r?   rA   r:   r;   r   r   r   r  s     r!   r   r     W        	     r#   c                  P    e Zd ZdZdZddddZedd	            ZddZd Z	d Z
dS )r  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__r  _global_namer<   takes_fieldr  Fr  r  c               z    | _         | _        | _        t          |          }|                                 _         j        s j        s fd _        n< j        r j        s fd _        n# j        s j        r fd _        n
 fd _        |                                }|| j        j        d<   d S d S )Nc                .                         |           S r/   r<   )r  rO  __r    s      r!   r   z$Converter.__init__.<locals>.<lambda>  s    1F1F r#   c                0                         | |          S r/   r  )r  instancer	  r    s      r!   r   z$Converter.__init__.<locals>.<lambda>
  s    x9 9 r#   c                0                         | |          S r/   r  )r  r	  r  r    s      r!   r   z$Converter.__init__.<locals>.<lambda>  s    T^^u6 6 r#   c                2                         | ||          S r/   r  )r  r  r  r    s      r!   r   z$Converter.__init__.<locals>.<lambda>  s    4>>x< < r#   r[   )	r<   r  r  r   get_first_param_typer  r  get_return_typer   )r    r<   r  r  exrts   `     r!   rH  zConverter.__init__  s
   "$&!),,!#!8!8!:!: 	4#3 	FFFFDMM_ 	T%5 	   DMM  	T%5 	   DMM   DM !!>68DM)(333 >r#   r   rU   r[   c                    d|  S )zh
        Return the name that a converter for an attribute name *attr_name*
        would have.
        __attr_converter_r   )r   s    r!   r  zConverter._get_global_name  s     /9...r#   r  c                ,   | j         s"| j        s|                     |           d| dS | j         r%| j        r|                     |           d| d| dS | j         r|                     |           d| dS |                     |           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`.
        re  r0  z, self, attr_dict['z'])z, self)z, attr_dict[')r  r  r  )r    r   r  s      r!   r  zConverter._fmt_converter_call"  s      	F4#3 	F++I66EEEEEE? 	ft/ 	f++I66eeeeW`eeee? 	L++I66KKKKKK''	22[[Y[[Y[[[[r#   c                ,    | j         | j        | j        dS )zx
        Return a dict containing only converter and takes_self -- the rest gets
        computed when loading.
        r<   r  r  r  r   s    r!   r,  zConverter.__getstate__3  s#     /+
 
 	
r#   c                      | j         di | dS )z+
        Load instance from state.
        Nr   r  r  s     r!   r-  zConverter.__setstate__>  s"     	r#   N)r   rU   r[   rU   )r   rU   r  rU   r[   rU   )r&   r'   r(   r)   ro  rH  r  r  r  r,  r-  r   r#   r!   r  r    s         (I 165 9 9 9 9 96 / / / \/\ \ \ \"	
 	
 	
    r#   c                J    g | ] }t          |t          d dd ddddd
  
        !S r  r  r  s     r!   r   r   E  r   r#   r  c                   t          j        d|           } t          |t                    r|}n:t          |t          t
          f          rd |D             }nd}t          |          |                    dd          }|                    dd          }|                    dd          }	i |                    |           ||d<   ||d<   |	|	d<   t          j
        | |i fd          }
t          j        t          t                    5  t          j        d	          j                            d
d          |
_        ddd           n# 1 swxY w Y   |                    dd          }t)          ||                    d          |                    d          d          \  |d<   |d<    t+          dd|i||
          }d |                                D             |_        |S )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.
    NFKCc                ,    i | ]}|t                      S r   )rR   r   s     r!   rk  zmake_class.<locals>.<dictcomp>  s    ///AAvxx///r#   z(attrs argument must be a dict or a list.r)  Nr*  rH  c                .    |                                S r/   )rN  )r  r~   s    r!   r   zmake_class.<locals>.<lambda>  s    		$ r#   r
   r&   __main__r9   r?   rA   Tr   c                2    i | ]\  }}|j         ||j         S r/   )r3   )r   ri  rj  s      r!   rk  zmake_class.<locals>.<dictcomp>  s.       a!&2D162D2D2Dr#   r   )unicodedata	normalizerJ   r0  rK   rL   rF   poprN  r  	new_classr`  ra  rb  rG   r{  	_getframe	f_globalsr   r'   r  r  r   r   )r   r   bases
class_bodyattributes_argumentsr  rQ   r  r  	user_inittype_r9   r   r~   s                @r!   
make_classr*  Z  sd   `  ..D% 	ED%=	)	) /////8nn||0$77H2D99IZ..IDJ%-!"&/"#$ZOD%-G-G-G-GHHE 
	^Z	8	8 
 
=++599

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
"
"5$
/
/C 	"  &&  ))		 	T"W% 9&
8
8x
8#7
8
8
?
?C &nn..  C Js   3EEE)r   r'  c                  ,    e Zd ZdZ e            Zd ZdS )_AndValidatorz2
    Compose many validators to a single one.
    c                4    | j         D ]} ||||           d S r/   )_validators)r    r  r   r  rj  s        r!   r  z_AndValidator.__call__  s5    ! 	! 	!AAdD%    	! 	!r#   N)r&   r'   r(   r)   rR   r.  r  r   r#   r!   r,  r,    s:          &((K! ! ! ! !r#   r,  c                     g }| D ]4}|                     t          |t                    r|j        n|g           5t          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   )
validatorsr  r7   s      r!   rN   rN     sh     D 
 
	)]33I!!	
 	
 	
 	
 t%%%r#   c                     t          d  D                       }|r fd}n fd} s-t          d          }|j                            ||d           nt	           d                                                   }|r
||j        d<    d         }t          st          |t                    r|j	        }t	          |          
                                }|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                    V  d S r/   rJ   r  )r   cs     r!   r   zpipe.<locals>.<genexpr>  s,      GGq*Q	22GGGGGGr#   c                l    D ]/}t          |t                    r || ||          n
 ||           } 0| S r/   r3  )r  r  r  r4  
converterss       r!   pipe_converterzpipe.<locals>.pipe_converter  sM      +5a+C+COAAc4'''3  Jr#   c                (    D ]} ||           } | S r/   r   )r  r4  r6  s     r!   r7  zpipe.<locals>.pipe_converter  s&      affJr#   A)r  r[   r   r  rf   r[   Tr  )r  r	   r   rN  r   r  r   rJ   r  r  r  )r6  return_instancer7  r9  tlastr  s   `      r!   rM   rM     sH     GGJGGGGGO 	 	 	 	 	 		 	 	 	 	  :CLL&--a1.E.EFFFF !A//DDFF 	645N*51"~ 	!
4 ; ; 	!=D "$''7799 	:79N*84 LDdKKKKr#   )NrS   )
rT   rU   rV   rW   rX   rY   rZ   rU   r[   r\   r/   )
rT   rU   rZ   rU   rV   rW   rc   rY   r[   rd   )rs   rU   rt   ru   r[   r3   )r[   r   )r[   r   )T)NNNNNNNFFTFFFFFNNFFNNNTNT)r   r3   r)  rU   r[   rU   )
r   r3   r   r   r  r#  r  r#  r[   r,  )r   r3   r   r   )r   rK   r[   r,  )r[   r,  )NN)r[   rz  r  r  )r   rU   r  rU   r  r#  r[   rU   )r  r#  r   r#  r   r   )r   r   r1  r#  r/  r#  r  r#  r  r#  r  r#  r  r#  r   r   r  r#  r  r#  r  r#  r  rU   r[   rz  )r   rU   r[   rU   )l
__future__r   rZ  r`  r  r*   r6  r  rk   r{  r  r  rV  collections.abcr   r   	functoolsr   typingr   r   r	   rS   r   r   r   r   r   r   r   r   r   
exceptionsr   r   r   r   objectr   r   r  r   r  r  r  r_  rM   r=  r<  r;  r  r   r   intr-   rR   rb   rr   r   r   r   r   r   r   r   r   r  r  r   r  r  rE   r  r   r  r  r   r  rG  r  r  r  r_  r  rm  r  rt  ry  r  r  r  r  r  r  r}  r   r   ro  _arO   r   _casrI   _fr  r*  r,  rN   r   r#   r!   <module>rG     s>	   # " " " " " 



                



       - - - - - - - - % % % % % % + + + + + + + + + + ( ' ' ' ' ' ' ' ' '                           !'   ) 2E2266  FHH	"gl7?G4DEE     ty   ( 
( ( ( ( ( ( ( (" 				

k k k kb )-	         $ +/	         F1 1 1 1.$ $ $ $ $* $ $ $0 0 0"' ' '# # # #B% % %8uE uE uE uEp1 1 1h  "  7 7 7tF	 F	 F	 F	 F	 F	 F	 F	R  8(( (( ((X .2   6 
			

3B B B BJ 
/ / /   E E E EP   	 	 	" " " "J5* 5* 5*p   "6# 6# 6# 6#r   + + +\& & &:. . .$/ / /B& B& B& B&J3 3 3 3] ] ] ]) ) ) )
W 
W 
W 
W,/ ,/ ,/ ,/^E E E EP   K K K K K K K K\  #  " IG	)2&&&66"666   >
=b
=
=
=  	Q Q Q Q Q Q Q Qh 		-0011_
 _
 _
 _
 _
 _
 _
 _
D  $  " WYYz666dCCC
$' $' $' $' $' $' $' $'N  !    )GGIIgR888CCC2
N
N
Na a a a a a a aH  ;    IGIIir***"555R  	 yTd d d dV Tt$$$	! 	! 	! 	! 	! 	! 	! %$	!& & &.9 9 9 9 9r#   