o
    Ñó·iÍ– ã                   @  sl  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
 +i ¡Z,e%ƒ Z-e .ej/ej0¡Z1G dd„ dej2ƒZ3e3j4Z4	 G dd„ de5ƒZ6e4ddddddddddddddfdd„Z7		d®d¯dd„Z8	d°d±d"d#„Z9d²d(d)„Z:G d*d+„ d+eƒZ;d,d-„ Z<d.d/„ Z=d³d1d2„Z>d3d4„ Z?d´d5d6„Z@d7d8„ ZAd9d:„ ZBd;d<„ ZCd=d>„ ZDG d?d@„ d@ƒZEdAdB„ ZFdCdD„ ZG	dµdEdF„ZH								G	G		G	G	G	G	G			G	G						d¶dHdI„ZIeIZJ	 dJdK„ ZKd·dNdO„ZLd¸dUdV„ZMd¹dWdX„ZNdYdZ„ ZOdºd\d]„ZPd^d_„ ZQd°d`da„ZRd»dbdc„ZSd¼ddde„ZTdfdg„ ZUdhdi„ ZVdjdk„ Z0dldm„ ZWd½dodp„ZXd¾dtdu„ZYd¿dxdy„ZZdÀd{d|„Z[d¿d}d~„Z\dÁd‚dƒ„Z]dÂdŽd�„Z^dÃd‘d’„Z_G d“d”„ d”ƒZ`d•d–„ e`jaD ƒZbeNeReTe`ebd—�d˜d–„ ebD ƒd—�d™d–„ ebD ƒd—�Z`G dšd›„ d›ƒZceReTecƒƒZcG dœd�„ d�ƒZddžd–„ edjaD ƒZeeReTedeed—�eed—�ZdG dŸd „ d ƒZfd¡d–„ efjaD ƒZgeNeReTefegd—�egd—�egd—�ZfG d¢dw„ dwƒZhd£d–„ d¤D ƒZgeNeReTehegd—�egd—�egd—�Zhe%fdfd¥d¦„ZieIddd§�G d¨d©„ d©ƒƒZjdªd«„ Zkd¬d­„ 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.ClassVarZ_attrs_cached_hashc                   @  s(   e Zd ZdZe ¡ Zdd„ Zd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                 C  ó   dS )NÚNOTHING© ©Úselfr   r   úPC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\attr/_make.pyÚ__repr__K   ó   z_Nothing.__repr__c                 C  r   )NFr   r   r   r   r   Ú__bool__N   r    z_Nothing.__bool__N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚenumÚautor   r   r!   r   r   r   r   r   >   s
    
r   c                   @  s"   e Zd ZdZedƒdfd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                 C  s   ||fS ©Nr   )r   Z_none_constructorÚ_argsr   r   r   Ú
__reduce__f   ó   z_CacheHashWrapper.__reduce__)r"   r#   r$   r%   Útyper+   r   r   r   r   r(   Z   s    r(   Tc                 C  s4  t |||dƒ\}}}}|dur|dur|durd}t|ƒ‚|	dur9| tur+d}t|ƒ‚t|	ƒs5d}t|ƒ‚t|	ƒ} |du r?i }t|ttfƒrKt	j
|Ž }|rXt|ttfƒrXt|Ž }|ret|ttfƒret
|Ž }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.
    TNFú6Invalid value for hash.  Must be True, False, or None.z=The `default` and `factory` arguments are mutually exclusive.z*The `factory` argument must be a callable.ÚdefaultÚ	validatorÚreprÚcmpÚhashÚinitÚ	converterÚmetadatar-   Úkw_onlyÚeqÚeq_keyÚorderÚ	order_keyÚ
on_setattrÚaliasr   )Ú_determine_attrib_eq_orderÚ	TypeErrorr   Ú
ValueErrorÚcallableÚFactoryÚ
isinstanceÚlistÚtupler   ÚpipeÚand_Ú_CountingAttr)r/   r0   r1   r2   r3   r4   r6   r-   r5   Úfactoryr7   r8   r:   r<   r=   r9   r;   Úmsgr   r   r   Úattribj   sp   :ÿÿ
ÿþýüûúùø	÷
öõôóòñðrK   Ú ÚscriptÚstrÚglobsúdict[str, Any] | NoneÚlocsúMapping[str, object] | NoneÚfilenameÚreturnÚNonec                 C  s   t | |dƒ}t|||ƒ dS )z[
    Evaluate the script with the given global (globs) and local (locs)
    variables.
    ÚexecN)ÚcompileÚeval)rM   rO   rQ   rS   Úbytecoder   r   r   Ú_compile_and_evalØ   s   
rZ   Úlocalsúdict[str, Any]c           	      C  s|   |du ri n|}d}|}	 t | ƒd|  d¡|f}tj ||¡}||kr$q5|dd… › d|› d�}|d7 }qt| |||ƒ |S )zP
    Cache the script with _linecache_, compile it and return the _locals_.
    Nr	   Téÿÿÿÿú-ú>)ÚlenÚ
splitlinesÚ	linecacheÚcacheÚ
setdefaultrZ   )	rM   rS   rO   r[   rQ   ÚcountÚbase_filenameZlinecache_tupleZold_valr   r   r   Ú_linecache_and_compileæ   s"   
üôrg   Úcls_nameÚ
attr_namesú	list[str]r-   c                 C  sF   | › d�}i }t |ƒD ]\}}|fdd„}t|ƒ||< q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))
    Z
Attributesc                 S  s   | | S r)   r   )r   Úir   r   r   Úgetter  r,   z&_make_attr_tuple_class.<locals>.getterN)Ú	enumerateÚpropertyr-   rE   )rh   ri   Zattr_class_nameÚbodyrk   Ú	attr_namerl   r   r   r   Ú_make_attr_tuple_class	  s   

rq   c                   @  s&   e Zd ZU ded< ded< ded< dS )Ú_Attributesr-   Úattrsúlist[Attribute]Ú
base_attrsúdict[str, type]Zbase_attrs_mapN)r"   r#   r$   Ú__annotations__r   r   r   r   rr      s   
 rr   c                 C  s2   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	   r]   N)rN   Ú
startswithÚendswithÚ_CLASSVAR_PREFIXES)Zannotr   r   r   Ú_is_class_var&  s   
r}   c                 C  s
   || j v S )zR
    Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
    N)Ú__dict__)ÚclsZattrib_namer   r   r   Ú_has_own_attribute7  s   
r€   ú'tuple[list[Attribute], dict[str, type]]c                 C  s¨   g }i }t | jdd… ƒD ]$}t|dg ƒD ]}|js|j|v r q|jdd�}| |¡ |||j< qqg }tƒ }t |ƒD ]}|j|v rCq;| d|¡ | 	|j¡ q;||fS )zQ
    Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
    r	   r]   Ú__attrs_attrs__T©Ú	inheritedr   N)
ÚreversedÚ__mro__Úgetattrr„   ÚnameÚevolveÚappendÚsetÚinsertÚadd)r   Útaken_attr_namesru   Úbase_attr_mapÚbase_clsÚaÚfilteredÚseenr   r   r   Ú_collect_base_attrs>  s$   
ú
r”   c                 C  sn   g }i }| j dd… D ]'}t|dg ƒD ]}|j|v rq|jdd�}| |j¡ | |¡ |||j< qq||fS )a-  
    Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.

    N.B. *taken_attr_names* will be mutated.

    Adhere to the old incorrect behavior.

    Notably it collects from the front and considers inherited attributes which
    leads to the buggy behavior reported in #428.
    r	   r]   r‚   Trƒ   N)r†   r‡   rˆ   r‰   r�   rŠ   )r   rŽ   ru   r�   r�   r‘   r   r   r   Ú_collect_base_attrs_broken_  s   

ù	r•   c              	     s2  | j ‰t| ƒ‰ |durt| ¡ ƒ}nd|du rgdd„ ˆ ¡ D ƒ}g }tƒ }ˆ  ¡ D ]$\}	}
t|
ƒr1q(| |	¡ ˆ |	t¡}|j	t
urEt|ƒ}| |	|f¡ q(|| }|rftdd t|‡fdd„d	�¡ d
 ƒ‚ntdd„ ˆ ¡ D ƒdd„ d	�}tj‰tjj‰‡ ‡‡‡fdd„|D ƒ}|r˜t| dd„ |D ƒƒ\}}nt| dd„ |D ƒƒ\}}ˆtjju r¸dd„ |D ƒ}dd„ |D ƒ}|| }|durÇt|| |ƒƒ}d}dd„ |D ƒD ]}|du rä|jtu räd|›�}t|ƒ‚|du rï|jturïd}qÐ|D ]}|j�st |¡dt|jƒƒ qòdd„ |D ƒ}t | j!|ƒ}t"||ƒ||ƒ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                 S  s   h | ]\}}|j tu r|’qS r   ©Ú	__class__rH   ©Ú.0rˆ   Úattrr   r   r   Ú	<setcomp>“  s    ýÿz#_transform_attrs.<locals>.<setcomp>z1The following `attr.ib`s lack a type annotation: ú, c                   s   ˆ   | ¡jS r)   )ÚgetÚcounter)Ún)Úcdr   r   Ú<lambda>©  s    z"_transform_attrs.<locals>.<lambda>)ÚkeyÚ.c                 s  s&   � | ]\}}|j tu r||fV  qd S r)   r–   r˜   r   r   r   Ú	<genexpr>¯  s   € ý
ÿz#_transform_attrs.<locals>.<genexpr>c                 S  s
   | d j S ©Nr	   )rž   )Úer   r   r   r¡   ´  ó   
 c              	     s(   g | ]\}}ˆ||ˆˆuˆ   |¡ƒ‘qS r   )r�   )r™   rp   Úca)ÚannsÚfcar7   Únor   r   Ú
<listcomp>¹  s    úüÿz$_transform_attrs.<locals>.<listcomp>c                 S  ó   h | ]}|j ’qS r   ©rˆ   ©r™   r‘   r   r   r   r›   Å  ó    c                 S  r­   r   r®   r¯   r   r   r   r›   É  r°   c                 S  ó   g | ]}|j d d�‘qS ©T)r7   ©r‰   r¯   r   r   r   r¬   Í  ó    c                 S  r±   r²   r³   r¯   r   r   r   r¬   Î  r´   Fc                 s  s(   � | ]}|j d ur|jd u r|V  qdS )FN)r4   r7   r¯   r   r   r   r¤   Û  s   €& zlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: r=   c                 S  s   g | ]}|j ‘qS r   r®   r¯   r   r   r   r¬   í  r°   )#r~   r   rD   Úitemsr‹   r}   r�   r�   r   r—   rH   rK   rŠ   r   ÚjoinÚsortedÚ	AttributeÚfrom_counting_attrÚ
ClassPropsÚKeywordOnlyÚNOr”   r•   ÚFORCErE   r/   r@   r=   Ú_OBJ_SETATTRÚ__get__Ú_default_init_alias_forrˆ   rq   r"   rr   )r   ÚtheseÚauto_attribsr7   Úcollect_by_mroÚfield_transformerZca_listZca_namesZannot_namesrp   r-   r‘   ZunannotatedZ	own_attrsru   r�   rs   Zhad_defaultrJ   ri   Z
AttrsClassr   )r©   r    rª   r7   r«   r   Ú_transform_attrs{  sŠ   þ

ÿÿüÿÿ	þú	ù

ÿÿ
€€rÅ   c                 C  sn   g d¢}|d ur|  d¡ n| g d¢¡ | ddg¡ t|dƒ}| tj|dœ}td |¡||d	|id
�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)r[   Ú__getattr__)rŠ   ÚextendÚ_generate_unique_filenamer¾   r¿   rg   r¶   )rÆ   rÈ   r   ÚlinesZunique_filenameÚglobr   r   r   Ú_make_cached_property_getattró  s.   ÿÿþÿ
ýÿþrÐ   c                 C  s(   t | tƒr|dv rt | ||¡ dS t‚)z4
    Attached to frozen classes as __setattr__.
    )Ú	__cause__Ú__context__Ú__traceback__Ú__suppress_context__Ú	__notes__N)rC   ÚBaseExceptionÚ__setattr__r   ©r   rˆ   Úvaluer   r   r   Ú_frozen_setattrs'  s   rÚ   c                 C  s&   t | tƒr|dv rt | |¡ dS t‚)z4
    Attached to frozen classes as __delattr__.
    )rÕ   N)rC   rÖ   Ú__delattr__r   )r   rˆ   r   r   r   Ú_frozen_delattrs8  s   rÜ   c            	      O  s„   z| \}W n t y   dt| ƒ› d�}t|ƒd‚w |j}t|ƒ}|D ]}|js)q#|j}|j}||vr:t||ƒ||< q#|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   )	r@   r`   r?   r—   Úfieldsr4   rˆ   r=   r‡   )	ÚargsÚchangesÚinstrJ   r   rs   r‘   rp   Z	init_namer   r   r   r‰   C  s$   %
ÿ
ü€r‰   c                   @  s¼   e Zd ZdZdZd7d
d„Zdd„ Zd8dd„Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Zd9d2d3„Zd9d4d5„Zd6S ):Ú_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   r-   rÂ   ÚboolÚpropsrº   Úhas_custom_setattrc                 C  s&  t ||||j|j|jƒ\}}}|| _|jrt|jƒni | _|| _	dd„ |D ƒ| _
|| _tdd„ |D ƒƒ| _|j| _|j| _|j| _|jtjju | _tt|ddƒƒ| _d| _| jrh|j}	t |	¡}
t|
j ƒdk| _tt|ddƒƒ| _!t|ƒ | _"|j#| _$|j%| _&|| _'d| _(| j	| jd	< || jd
< |jr¡t)| jd< t*| jd< d| _(nC| j&t+t,j-t,j.fv räd }}|D ]}|j/d urºd}|j0d urÁd}|rÇ|rÇ qÈq±| j&t+krÑ|sÑ|rá| j&t,j-krÙ|rá| j&t,j.krä|säd | _&|j1ró|  2¡ \| jd< | jd< g | _3d| _4t5| jdƒ�rt5| jdƒ�s| j6| _7d S | j8| _7d S )Nc                 S  r­   r   r®   r¯   r   r   r   r›   ®  r°   z)_ClassBuilder.__init__.<locals>.<setcomp>c                 s  s   � | ]}|j V  qd S r)   r®   r¯   r   r   r   r¤   °  s   € z)_ClassBuilder.__init__.<locals>.<genexpr>Ú__attrs_pre_init__Fr	   Ú__attrs_post_init__r‚   Z__attrs_props__r×   rÛ   TÚ__getstate__Ú__setstate__r#   r$   )9rÅ   r7   Úcollected_fields_by_mrorÄ   rÊ   Ú
is_slottedÚdictr~   rè   rä   ræ   rå   rE   rã   ró   Ú	is_frozenrê   Úhas_weakref_slotrô   Úhashabilityrº   ÚHashabilityÚHASHABLE_CACHEDrç   rö   r‡   rí   rð   rù   ÚinspectÚ	signaturer`   Ú
parametersrì   ré   Úis_exceptionrî   Úon_setattr_hookrï   rë   rõ   rÚ   rÜ   Ú_DEFAULT_ON_SETATTRr   ÚvalidateÚconvertr0   r5   Úadded_picklingÚ_make_getstate_setstaterò   rñ   ÚhasattrÚ_add_method_dunders_saferâ   Ú_add_method_dunders_unsafe)r   r   rÁ   rÂ   r÷   rø   rs   ru   Zbase_mapZpre_init_funcZpre_init_signatureZhas_validatorZhas_converterr‘   r   r   r   Ú__init__š  sž   
ú	ÿ



ý

€þýý
ûû
úúýþÿz_ClassBuilder.__init__c                 C  s   d| j j› d�S )Nz<_ClassBuilder(cls=z)>)rÊ   r"   r   r   r   r   r   ÿ  s   z_ClassBuilder.__repr__rT   rU   c                 C  sl   d  dd„ | jD ƒ¡}i }| jD ]
\}}}| |¡ qt|t| jdƒ|ƒ}| jD ]\}}}|| j|ƒ q(dS )z=
        Evaluate any registered snippets in one go.
        rÉ   c                 S  s   g | ]}|d  ‘qS )r   r   )r™   Zsnippetr   r   r   r¬     ó    z0_ClassBuilder._eval_snippets.<locals>.<listcomp>ÚmethodsN)r¶   rò   Úupdaterg   rÍ   rÊ   rè   )r   rM   rO   Ú_Zsnippet_globsrQ   Úhookr   r   r   Ú_eval_snippets  s   
ýÿz_ClassBuilder._eval_snippetsc                 C  sb   |   ¡  | jdu r|  ¡ }t |¡| j_n|  ¡ }tr t	 
|¡}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)r  ró   Ú_create_slots_classÚweakrefÚrefrÊ   Z__attrs_base_of_slotted__Ú_patch_original_classr   ÚabcÚupdate_abstractmethodsr‡   r~   r  )r   r   r   r   r   Úbuild_class  s   


ÿþz_ClassBuilder.build_classc              	   C  s²   | j }| j}| jr5| jD ](}||vr4t||tƒtur4t t¡� t	||ƒ W d  ƒ q1 s/w   Y  q| j
 ¡ D ]
\}}t|||ƒ q:| jsWt|ddƒrWd|_| jsWt|_|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Ù   r   r   r   r  -  s*   
ÿþÿ€ÿz#_ClassBuilder._patch_original_classc              
     sÎ  ‡fdd„ˆj  ¡ D ƒ}ttdƒrt ˆj¡ ˆjs5d|d< ˆjs5ˆjjD ]‰ ˆ j	 
dd¡r4t|d<  q5q%i }d}ˆjjdd… D ]‰ ˆ j	 
d	d
¡d
urNd}| ‡ fdd„tˆ dg ƒD ƒ¡ qAtˆjƒ‰ˆj}ˆjr}d	tˆjddƒvr}d	|vr}|s}|d7 }dd„ | ¡ D ƒ}g }|rÌtˆjƒ}| ¡ D ]!\}}	||f7 }||= | |	¡ t |	¡j}
|
tjjur´|
||< q“| 
d¡}|d
urÃ| |¡ t||ˆjƒ|d< ‡fdd„|D ƒ‰‡fdd„| ¡ D ƒ‰‡fdd„ˆD ƒ‰| ˆ¡ ˆjröˆ t¡ tˆƒ|d< ˆjj|d< tˆjƒˆjj ˆjj|ƒ}t! "|j	 #¡ |¡D ]L}t$|t%t&fƒ�r*t|j'dd
ƒ}nt$|t(ƒ�r8t|j)dd
ƒ}nt|dd
ƒ}|�sC�q|D ]}z|j*ˆju }W n t+�yZ   Y �qEw |�ra||_*�qE�q|S )zL
        Build and return a new class with a `__slots__` attribute.
        c                   s2   i | ]\}}|g t ˆ jƒ¢d ‘d‘R vr||“qS )r~   Ú__weakref__)rE   rã   ©r™   ÚkÚvr   r   r   Ú
<dictcomp>U  s    ýÿz5_ClassBuilder._create_slots_class.<locals>.<dictcomp>Ú_clear_type_descriptorsFr!  r×   r	   r]   r)  NTc                   ó   i | ]}|t ˆ |ƒ“qS r   ©r‡   ©r™   rˆ   )r�   r   r   r-  x  s    
ÿÿÚ	__slots__r   )r)  c                 S  s"   i | ]\}}t |tƒr||j“qS r   )rC   r   Úfunc)r™   rˆ   Zcached_propr   r   r   r-  ‰  s    ýÿrË   c                   ó   g | ]}|ˆ vr|‘qS r   r   r1  )r(  r   r   r¬   ¨  r´   z5_ClassBuilder._create_slots_class.<locals>.<listcomp>c                   s   i | ]\}}|ˆ v r||“qS r   r   )r™   ZslotZslot_descriptor)Ú
slot_namesr   r   r-  ®  s    ýÿc                   r4  r   r   r1  )Úreused_slotsr   r   r¬   ³  r´   r$   Ú__closure__),rè   rµ   r  Úsysr.  rÊ   rõ   rë   Ú	__bases__r~   r�   r¾   r†   r  r‡   r‹   ræ   rã   rô   r   rŠ   r  r  Úreturn_annotationÚ	ParameterÚemptyrÐ   rç   Ú_HASH_CACHE_FIELDrE   r$   r-   r"   Ú	itertoolsÚchainÚvaluesrC   ÚclassmethodÚstaticmethodÚ__func__rn   ÚfgetÚcell_contentsr@   )r   r    Zexisting_slotsZweakref_inheritedÚnamesrÆ   Z&additional_closure_functions_to_updateZclass_annotationsrˆ   r3  Ú
annotationrÈ   r   ÚitemZclosure_cellsÚcellÚmatchr   )r�   r(  r6  r   r5  r   r  Q  s¬   
þ

þ

þÿ
ÿþýüþ


€

ÿ
þ


ÿþ€ø	z!_ClassBuilder._create_slots_classc                   s8   t ˆ j|ƒ\}}‡ fdd„}ˆ j |||f¡ dˆ _ˆ S )Nc                   ó   ˆ   |d ¡| d< d S )Nr   ©râ   ©Úcls_dictrO   r   r   r   Ú_attach_reprã  ó   z,_ClassBuilder.add_repr.<locals>._attach_reprT)Ú_make_repr_scripträ   rò   rŠ   rñ   )r   ÚnsrM   rO   rO  r   r   r   Úadd_reprà  s
   z_ClassBuilder.add_reprc                 C  s.   | j s	d}t|ƒ‚dd„ }|  |¡| jd< | S )Nz3__str__ can only be generated if a __repr__ exists.c                 S  s   |   ¡ S r)   ©r   r   r   r   r   Ú__str__ï  r,   z&_ClassBuilder.add_str.<locals>.__str__rU  )rñ   r@   râ   rè   )r   rJ   rU  r   r   r   Úadd_strê  s   z_ClassBuilder.add_strc                   s<   t dd„ | jD ƒƒ‰‡fdd„}| j‰ ‡ ‡fdd„}||fS )zF
        Create custom __setstate__ and __getstate__ methods.
        c                 s  s   � | ]	}|d kr|V  qdS )r)  Nr   )r™   Zanr   r   r   r¤   ú  s   € ÿ
ÿz8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>c                   s   ‡ fdd„ˆD ƒS )ú9
            Automatically created by attrs.
            c                   r/  r   r0  r1  r   r   r   r-    r´   zQ_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate.<locals>.<dictcomp>Nr   r   )Ústate_attr_namesr   r   Úslots_getstateþ  ó   z=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstatec                   sh   t  | ¡}t|tƒrtˆ|ƒD ]\}}|||ƒ qˆD ]}||v r(|||| ƒ qˆ r2|tdƒ dS dS )rW  N)r¾   r¿   rC   rE   Úzipr=  )r   ÚstateZ_ClassBuilder__bound_setattrrˆ   rÙ   ©Zhash_caching_enabledrX  r   r   Úslots_setstate  s   

€ÿz=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstateN)rE   rã   rç   )r   rY  r^  r   r]  r   r  õ  s   ÿz%_ClassBuilder._make_getstate_setstatec                 C  s   d | j d< | S ©NÚ__hash__)rè   r   r   r   r   Úmake_unhashable  s   
z_ClassBuilder.make_unhashablec                   s@   t ˆ jˆ jˆ jˆ jd�\}}d	‡ fdd„}ˆ j |||f¡ ˆ S )
N©ÚfrozenÚ
cache_hashrN  rÿ   rQ   rT   rU   c                   rK  r_  rL  )rN  rQ   r   r   r   Úattach_hash*  rP  z+_ClassBuilder.add_hash.<locals>.attach_hash)rN  rÿ   rQ   rÿ   rT   rU   )Ú_make_hash_scriptrÊ   rä   rê   rç   rò   rŠ   )r   rM   rO   re  r   r   r   Úadd_hash"  s   
üz_ClassBuilder.add_hashc                   ó`   t ˆjˆjˆjˆjˆjˆjˆjˆjˆj	ˆj
ˆjdd�\}}‰ ‡ ‡fdd„}ˆj |||f¡ ˆS )NF©Ú
attrs_initc                   ó    |d }ˆ |_ ˆ |¡| d< d S )Nr  ©rw   râ   ©rN  rO   r4   ©r   r   r   r   Ú_attach_initA  ó   z,_ClassBuilder.add_init.<locals>._attach_init©Ú_make_init_scriptrÊ   rä   rí   rð   rì   rê   ró   rç   rå   rî   rï   rò   rŠ   )r   rM   rO   ro  r   rn  r   Úadd_init1  ó"   ôz_ClassBuilder.add_initc                 C  s   |   dd„ ¡| jd< | S )Nc                 [  s   t | fi |¤ŽS r)   r³   )r   rß   r   r   r   r¡   L  s    z+_ClassBuilder.add_replace.<locals>.<lambda>Ú__replace__)râ   rè   r   r   r   r   Úadd_replaceJ  s   
ÿz_ClassBuilder.add_replacec                 C  s   t dd„ | jD ƒƒ| jd< d S )Nc                 s  s"   � | ]}|j r|js|jV  qd S r)   )r4   r7   rˆ   )r™   Úfieldr   r   r   r¤   Q  s   € ýý
ÿz/_ClassBuilder.add_match_args.<locals>.<genexpr>Ú__match_args__)rE   rä   rè   r   r   r   r   Úadd_match_argsP  s   þz_ClassBuilder.add_match_argsc                   rh  )NTri  c                   rk  )NÚ__attrs_init__rl  rm  rn  r   r   Ú_attach_attrs_initg  rp  z8_ClassBuilder.add_attrs_init.<locals>._attach_attrs_initrq  )r   rM   rO   r{  r   rn  r   Úadd_attrs_initW  rt  z_ClassBuilder.add_attrs_initc                   s>   ˆ j }tˆ jƒ\}}‡ fdd„}ˆ j |||f¡ t|d< ˆ S )Nc                   rK  )NÚ__eq__rL  rM  r   r   r   Ú
_attach_equ  rP  z(_ClassBuilder.add_eq.<locals>._attach_eqÚ__ne__)rè   Ú_make_eq_scripträ   rò   rŠ   r  )r   r    rM   rO   r~  r   r   r   Úadd_eqp  s   z_ClassBuilder.add_eqc                   s>   ˆ j }‡ fdd„tˆ jˆ jƒD ƒ\|d< |d< |d< |d< ˆ S )Nc                 3  s   � | ]}ˆ   |¡V  qd S r)   rL  )r™   Úmethr   r   r   r¤   �  s
   € ÿ
ÿz*_ClassBuilder.add_order.<locals>.<genexpr>Ú__lt__Ú__le__Ú__gt__Ú__ge__)rè   Ú_make_orderrÊ   rä   )r   r    r   r   r   Ú	add_order~  s
   
þz_ClassBuilder.add_orderc                   s‚   i ‰ | j D ]}|jp| j}|r|tjur||fˆ |j< qˆ s | S | jr)d}t|ƒ‚‡ fdd„}d| jd< |  	|¡| jd< d| _
| S )Nz7Can't combine custom __setattr__ with on_setattr hooks.c                   sD   zˆ | \}}W n t y   |}Y nw || ||ƒ}t| ||ƒ d S r)   )ÚKeyErrorr¾   )r   rˆ   Úvalr‘   r  Znval©Zsa_attrsr   r   r×   ˜  s   ÿz._ClassBuilder.add_setattr.<locals>.__setattr__Tr!  r×   )rä   r<   rï   r   ÚNO_OPrˆ   rë   r@   rè   râ   rõ   )r   r‘   r<   rJ   r×   r   r‹  r   Úadd_setattrˆ  s    
€

z_ClassBuilder.add_setattrÚmethodr   c                 C  s6   | 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 N)rÊ   r#   r$   r"   r%   ©r   rŽ  r   r   r   r  ¨  s
   
ÿz(_ClassBuilder._add_method_dunders_unsafec                 C  s¶   t  t¡� | jj|_W d  ƒ n1 sw   Y  t  t¡� | jj› d|j› �|_W d  ƒ n1 s5w   Y  t  t¡� d| jj› d�|_W d  ƒ |S 1 sTw   Y  |S )zL
        Add __module__ and __qualname__ to a *method* if possible.
        Nr£   r�  )r#  r$  r%  rÊ   r#   r$   r"   r%   r�  r   r   r   r  ¶  s   ÿÿ
ÿýz&_ClassBuilder._add_method_dunders_safeN)r   r-   rÂ   rö   r÷   rº   rø   rö   )rT   rU   )rŽ  r   rT   r   )r"   r#   r$   r%   r2  r  r   r  r   r  r  rS  rV  r  ra  rg  rs  rv  ry  r|  r�  rˆ  r�  r  r  r   r   r   r   rá   }  s0    
e
$ 
)

 rá   c                 C  st   | durt |du|dufƒrd}t|ƒ‚| dur| | fS |du r"|}|du r(|}|du r6|du r6d}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.©Úanyr@   )r2   r8   r:   Ú
default_eqrJ   r   r   r   Ú_determine_attrs_eq_orderÆ  s   r—  c           	      C  s¸   | durt |du|dufƒrd}t|ƒ‚dd„ }| dur(|| ƒ\} }| || |fS |du r2|d}}n||ƒ\}}|du rB||}}n||ƒ\}}|du rV|du rVd}t|ƒ‚||||fS )r‘  Nr’  c                 S  s&   t | ƒrd| } }| |fS d}| |fS )z8
        Decide whether a key function is used.
        TN)rA   )rÙ   r¢   r   r   r   Údecide_callable_or_booleanë  s
   
ÿz>_determine_attrib_eq_order.<locals>.decide_callable_or_booleanFTr“  r”  )	r2   r8   r:   r–  rJ   r˜  Zcmp_keyr9   r;   r   r   r   r>   â  s"   r>   c                 C  sF   |du s|du r
|S |du r|du r|S |D ]
}t | |ƒr  dS q|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.
    TFN)r€   )r   ÚflagÚauto_detectZdundersr/   Zdunderr   r   r   Ú_determine_whether_to_implement  s   
ÿr›  Fc                   s¢   ˆdurddl }|jtdƒdd� t|||dƒ\‰‰|dur |‰
tˆttfƒr,tjˆŽ ‰‡ ‡‡‡‡‡‡‡‡‡	‡
‡‡‡‡‡‡‡‡‡‡‡fdd„}| du rM|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                   sÀ  ˆpt | ƒ}ˆdu ot| tƒ}ˆot| dƒ}|r |r d}t|ƒ‚| o)t| ˆˆdƒ}tj}|r3|j}nIˆ
du r@ˆr<|j	n|j
}n<ˆ
du rH|j}n4ˆ
d u rvˆdu rYt| dƒrY|j}n#|du rj|du rjˆrf|j	n|j
}n|du rr|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ˆ“dˆ“Ž}
|
jsæˆræd}t|ƒ‚t| ˆˆ |
|d�}|
jr÷| ˆ¡ |
jrþ| ¡  |
j�r| ¡  |
j�r| ¡  ˆ�s| ¡  |
j�r| ¡  n|
j|ju �r)| ¡  |
j�r2|  ¡  n| !¡  ˆ�r?d}t|ƒ‚t"�rLt| d ƒ�sL| #¡  t$�r\ˆ�r\t| d!ƒ�s\| %¡  | &¡ S )#NTr×   z/Can't freeze a class with a custom __setattr__.)r}  r  Fr`  r.   r  r   rþ   rý   Ú
added_init©r  Ú
added_reprrT  Úadded_eqÚadded_ordering)rƒ  r„  r…  r†  r  Úadded_match_argsr7   r  Ú	added_strr  )rû   rü   )r/   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.ru  rx  r   )'Ú_has_frozen_base_classÚ
issubclassrÖ   r€   r@   r›  rº   r  ÚLEAVE_ALONEr  ÚHASHABLEÚ
UNHASHABLEr?   r»   r½   ÚYESr¼   Úis_hashablerá   r   rS  r¤  rV  r¡  r�  r¢  rˆ  r�  rg  r  ra  rž  rs  r|  r   rv  r   ry  r   )r   r   Úis_excZhas_own_setattrrJ   r8   r  r  r»   Zkwor÷   Zbuilder©rÂ   rš  Úauto_excrd  rÃ   Zeq_rÄ   Úforce_kw_onlyrc  Úgetstate_setstater3   r4   r7   Ú
match_argsr<   Zorder_r1   Úrepr_nsÚslotsrN   rÁ   Úweakref_slotr   r   Úwrap›  s   ÿÿÿýÿýÿþýüÿûÿøõü€óíìëêéûèá à
#û


ÿþýzattrs.<locals>.wrap)	ÚwarningsÚwarnÚDeprecationWarningr—  rC   rD   rE   r   rF   )Z	maybe_clsrÁ   r²  r1   r2   r3   r4   r³  rc  r´  rN   rÂ   r7   rd  r®  r8   r:   rš  rÃ   r°  r<   rÄ   r±  Úunsafe_hashr¯  r¶  rµ  r   r­  r   rs   '  s$   aÿü
6 rs   c                 C  s
   | j tu S )zV
    Check whether *cls* has a frozen ancestor by looking at its
    __setattr__.
    N)r×   rÚ   )r   r   r   r   r¥  3  s   
r¥  r   Ú	func_namec              	   C  s$   d|› d| j › dt| d| jƒ› d�S )zF
    Create a "filename" suitable for a function being generated.
    z<attrs generated ú r£   r$   r_   N)r#   r‡   r"   )r   rº  r   r   r   rÍ   ;  s   ÿÿrÍ   rt   rc  rö   rd  útuple[str, dict]c                   s  t dd„ ˆ D ƒƒ‰ d}tt| dƒƒ‰i ‰d}d‰d‰|s!|d7 }n|d	7 }|d
7 }dˆ ‰ˆd7 ‰|g‰‡ ‡‡‡‡‡fdd„}|ryˆ |dt› d� ¡ |rc|dt› d�|d ƒ ˆ |d d ¡ n|dt› d�|d ƒ ˆ |dt› � ¡ n|d|ƒ d ˆ¡}|ˆfS )Nc                 s  s2   � | ]}|j d u s|j du r|jd u r|V  qdS )TN)r3   r8   r¯   r   r   r   r¤   H  s   € 
ÿÿÿ
ÿz$_make_hash_script.<locals>.<genexpr>ú        r3   zdef __hash__(selfzhash((z))z):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper(ú)c              	     s˜   ˆ  ||  ˆ |dˆ› d� g¡ ˆ D ]-}|jr4d|j› d�}|jˆ|< ˆ |d|› d|j› d� ¡ qˆ |d|j› d� ¡ qˆ |d ˆ ¡ 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½  ú,r  Ú_keyú(self.z),ú        self.ú    N)rÌ   r9   rˆ   rŠ   )ÚprefixÚindentr‘   Úcmp_name©rs   Zclosing_bracesrO   Z	hash_funcZmethod_linesZ	type_hashr   r   Úappend_hash_computation_lines`  s   
þÿ
ÿz8_make_hash_script.<locals>.append_hash_computation_lineszif self.z	 is None:zobject.__setattr__(self, 'ú', rœ  úself.ú = zreturn self.zreturn rÉ   )rE   r3   rÍ   rŠ   r=  r¶   )r   rs   rc  rd  ÚtabZhash_defrÈ  rM   r   rÇ  r   rf  E  s>   ÿ
ÿÿ

rf  c                 C  s6   t | |ddd�\}}t||t| dƒd� |d | _| S )z%
    Add a hash method to *cls*.
    Frb  r`  ©rS   N)rf  rZ   rÍ   r`  ©r   rs   rM   rO   r   r   r   Ú	_add_hash�  s   
ÿÿ
rÏ  c                 C  s   |   |¡}|tu rtS | S )z^
    Check equality and either forward a NotImplemented or
    return the result negated.
    N)r}  ÚNotImplemented)r   ÚotherÚresultr   r   r   r  ›  s   
r  rD   c                 C  sÚ   dd„ | D ƒ} g d¢}i }| r_|  d¡ | D ]B}|jr<d|j› d�}|j||< |  d|› d|j› d	|› d
|j› d�	¡ n|  d|j› d|j› �¡ || d urX|d › d�|d< q|  d¡ n|  d¡ d |¡}||fS )z6
    Create __eq__ method for *cls* with *attrs*.
    c                 S  ó   g | ]}|j r|‘qS r   )r8   r¯   r   r   r   r¬   «  ó    z#_make_eq_script.<locals>.<listcomp>)zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz    return  (r  rÀ  r½  rÁ  z) == z(other.r¾  rÂ  z
 == other.r]   z andz    )z    return TruerÉ   N)rŠ   r9   rˆ   r¶   )rs   rÎ   rO   r‘   rÆ  rM   r   r   r   r€  §  s(   

 ÿ€

r€  c                   sV   dd„ ˆ D ƒ‰ ‡ fdd„‰‡fdd„}‡fdd„}‡fd	d
„}‡fdd„}||||fS )z9
    Create ordering methods for *cls* with *attrs*.
    c                 S  rÓ  r   )r:   r¯   r   r   r   r¬   Ð  rÔ  z_make_order.<locals>.<listcomp>c                   s    t dd„ ‡ fdd„ˆD ƒD ƒƒS )z&
        Save us some typing.
        c                 s  s$   � | ]\}}|r||ƒn|V  qd S r)   r   )r™   rÙ   r¢   r   r   r   r¤   Ö  s
   € ÿ
ÿz6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>c                 3  s"   � | ]}t ˆ |jƒ|jfV  qd S r)   )r‡   rˆ   r;   r¯   ©Úobjr   r   r¤   Ø  s   € 
ÿN)rE   rÕ  ©rs   rÕ  r   Úattrs_to_tupleÒ  s
   
ÿþz#_make_order.<locals>.attrs_to_tuplec                   s    |j | j u rˆ | ƒˆ |ƒk S tS ©z1
        Automatically created by attrs.
        N©r—   rÐ  ©r   rÑ  ©rØ  r   r   rƒ  Ý  ó   z_make_order.<locals>.__lt__c                   s    |j | j u rˆ | ƒˆ |ƒkS tS rÙ  rÚ  rÛ  rÜ  r   r   r„  æ  rÝ  z_make_order.<locals>.__le__c                   s    |j | j u rˆ | ƒˆ |ƒkS tS rÙ  rÚ  rÛ  rÜ  r   r   r…  ï  rÝ  z_make_order.<locals>.__gt__c                   s    |j | j u rˆ | ƒˆ |ƒkS tS rÙ  rÚ  rÛ  rÜ  r   r   r†  ø  rÝ  z_make_order.<locals>.__ge__Nr   )r   rs   rƒ  r„  r…  r†  r   )rs   rØ  r   r‡  Ì  s   				r‡  c                 C  sB   |du r| j }t|ƒ\}}t||t| dƒd� |d | _t| _| S )z5
    Add equality methods to *cls* with *attrs*.
    Nr}  rÍ  )r‚   r€  rZ   rÍ   r}  r  rÎ  r   r   r   Ú_add_eq  s   ÿ
rÞ  c                 C  sî   t dd„ | D ƒƒ}dd„ |D ƒ}t|d< t|d< t|d< g }|D ]'\}}}|r+d| nd	| d
 }|tkr;d||f nd|||f }	| |	¡ q d |¡}
|du rTd}n|d }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                 s  s8   � | ]}|j d ur|j|j du rt n|j |jfV  qdS )FTN)r1   rˆ   r4   r¯   r   r   r   r¤     s   € ý
ÿz$_make_repr_script.<locals>.<genexpr>c                 S  s$   i | ]\}}}|t kr|d  |“qS )Ú_repr)r1   )r™   rˆ   Úrr  r   r   r   r-  !  s
    ÿÿz%_make_repr_script.<locals>.<dictcomp>r
   r%  r   rÊ  zgetattr(self, "z", NOTHING)z	%s={%s!r}z%s={%s_repr(%s)}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É   )rE   r
   r%  r   r1   rŠ   r¶   )rs   rR  Zattr_names_with_reprsrO   Zattribute_fragmentsrˆ   rà  rk   ÚaccessorÚfragmentZrepr_fragmentZcls_name_fragmentrÎ   r   r   r   rQ    sN   þÿÿÿý
ñrQ  c                 C  s>   |du r| j }t||ƒ\}}t||t| dƒd� |d | _| S )z%
    Add a repr method to *cls*.
    Nr   rÍ  )r‚   rQ  rZ   rÍ   r   )r   rR  rs   rM   rO   r   r   r   Ú	_add_reprN  s   ÿ
rä  c                 C  sv   t | ƒ}|du rt| tƒsd}t|ƒ‚t| ddƒ}|du r9|dur0t|ddƒ}|dur0|| _|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   rC   r-   r?   r‡   r‚   r   )r   Zgeneric_baserJ   rs   r   r   r   rÝ   ]  s   
rÝ   c                 C  sJ   t | tƒsd}t|ƒ‚t| ddƒ}|du r| ›d�}t|ƒ‚d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
    rå  r‚   Nræ  c                 S  s   i | ]}|j |“qS r   r®   r¯   r   r   r   r-  ¥  r  zfields_dict.<locals>.<dictcomp>)rC   r-   r?   r‡   r   )r   rJ   rs   r   r   r   Úfields_dict‹  s   

rç  c                 C  sD   t jdu rdS t| jƒD ]}|j}|dur|| |t| |jƒƒ q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   Z_run_validatorsrÝ   r—   r0   r‡   rˆ   )rà   r‘   r,  r   r   r   r  ¨  s   
	€ýr  c                 C  s   |  | ¡}|od|jv S )z>
    Check if the attribute name comes from a slot class.
    r2  N)r�   r~   )Úa_namer�   r   r   r   r   Ú_is_slot_attrº  s   
ré  útuple[str, dict, dict]c                 C  s  |
d uo|
t ju}|r|rd}t|ƒ‚|p|}g }i }|D ]1}|js(|jtu r(q| |¡ |||j< |jd urD|du rAd}t|ƒ‚d}q|rN|jt jurNd}qt	|||||||||	|||r_dndƒ\}}}| j
tjv ru| tj| j
 j¡ | t|dœ¡ |r„tj|d< |||fS )Nz$Frozen classes can't use on_setattr.Trz  r  )r   Ú	attr_dictrÇ   )r   rŒ  r@   r4   r/   r   rŠ   rˆ   r<   Ú_attrs_to_init_scriptr#   r8  Úmodulesr  r~   r¾   r¿   )r   rs   Úpre_initÚpre_init_has_argsÚ	post_initrc  r³  rd  r�   r¬  Zcls_on_setattrrj  Úhas_cls_on_setattrrJ   Úneeds_cached_setattrZfiltered_attrsrë  r‘   rM   rO   r   r   r   r   rr  Â  sR   ÿ


€

ô

rr  rp   Ú	value_varÚhas_on_setattrc                 C  s   d| › d|› d�S )zJ
    Use the cached object.setattr to set *attr_name* to *value_var*.
    ú
_setattr('rÉ  r¾  Nr   ©rp   ró  rô  r   r   r   Ú_setattr  rZ  r÷  r5   Ú	Converterc                 C  s   d| › d|  | |¡› d�S )zk
    Use the cached object.setattr to set *attr_name* to *value_var*, but run
    its converter first.
    rõ  rÉ  r¾  N)Ú_fmt_converter_call©rp   ró  rô  r5   r   r   r   Ú_setattr_with_converter  s   rû  rÙ   c                 C  s    |rt | |dƒS d| › d|› �S )zo
    Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
    relegate to _setattr.
    TrÊ  rË  N)r÷  )rp   rÙ   rô  r   r   r   Ú_assign  s   rü  c                 C  s*   |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Ê  rË  N)rû  rù  rú  r   r   r   Ú_assign_with_converter#  s   rý  r³  r�   rv   c                   sJ   | du r |du rdt tfS d‡ fd	d
„}d‡ fd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   rp   rN   ró  rô  rö   rT   c                   s&   t | ˆ ƒrt| ||ƒS d| › d|› �S ©Nú_inst_dict['z'] = )ré  r÷  rö  ©r�   r   r   Ú
fmt_setter@  s   
z&_determine_setters.<locals>.fmt_setterr5   rø  c                   s4   |st | ˆ ƒrt| |||ƒS d| › d| | |¡› �S rþ  )ré  rû  rù  rú  r   r   r   Úfmt_setter_with_converterH  s
   ÿz5_determine_setters.<locals>.fmt_setter_with_converter)z_inst_dict = self.__dict__N©rp   rN   ró  rN   rô  rö   rT   rN   ©
rp   rN   ró  rN   rô  rö   r5   rø  rT   rN   )r÷  rû  rü  rý  )rc  r³  r�   r  r  r   r   r   Ú_determine_setters0  s   
ý
r  r   rþ   Úcall_pre_initrï  Úcall_post_initÚdoes_cache_hashr¬  rò  rñ  Úmethod_namec           $   
   C  s´  |rdgng }|	r|  d¡ t|||ƒ\}}}| |¡ g }g }g }g }i }ddi}| D �]Ö}|jr7|  |¡ |j}|jdupF|jtjuoF|
}|j}t	|j
tƒ}|rX|j
jrXdnd}|jdurkt	|jtƒskt|jƒ}n|j}|jdu rÜ|r°t|jf }|dur™|  |||d|› d	� ||ƒ¡ |j|| |j¡< n|  |||d|› d	� |ƒ¡ |j
j||< �n.|durÍ|  ||d
|› d�||ƒ¡ |j|| |j¡< �n|  ||d
|› d�|ƒ¡ �n|j
tu�r#|�s#|› d|› d�}|jrö|  |¡ n
|  |¡ |  |¡ |du�r|  |||||ƒ¡ |j|| |j¡< nÅ|  ||||ƒ¡ n»|�r¨|› d�}|j�r5|  |¡ n
|  |¡ |  |¡ |  d|› d�¡ t|jf }|du�r€|  d|||||ƒ ¡ |  d¡ |  d|||d | d	 ||ƒ ¡ |j|| |j¡< n!|  d||||ƒ ¡ |  d¡ |  d|||d | d	 |ƒ ¡ |j
j||< n6|j�r²|  |¡ n
|  |¡ |  |¡ |du�rÕ|  |||||ƒ¡ |j|| |j¡< n	|  ||||ƒ¡ |jdu �r|jdu�rõ|du �rõ|j||< q,|du�r|j�r|j||< q,|�r9t|d< |  d¡ |D ]&}d|j }d|j }|  d|› d|› d|j› d	�¡ |j||< |||< �q|�rA|  d¡ |�rc|�rX|�rQdt› d�} ndt› d�} ndt› d�} |  | ¡ |�ryd  d!d"„ | D ƒ¡}!|  d#|!› d	�¡ d$ |¡}d$ |¡}|�r³||�rŒd$nd› d%d$ |¡› �7 }d$ d&d'„ d(d"„ |D ƒD ƒ¡}"||�r¬d$nd7 }||"7 }|�rÁ|�rÁd)|› d	�|d*< d+}#d,|› d|› d-|�rÒ|# |¡nd.› d/�||fS )0z«
    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)rT   Nr   rL   Frá  r¾  zattr_dict['z
'].defaultz=attr_dict['z=NOTHINGzif z is not NOTHING:rÃ  zelse:Tr   z#if _config._run_validators is True:Z__attr_validator_Z__attr_z(self, z, self.zself.__attrs_post_init__()rõ  z', None)rÿ  z	'] = NonerÊ  z = Noner¿  c                 s  s"   � | ]}|j rd |j› �V  qdS )rÊ  N)r4   rˆ   r¯   r   r   r   r¤   E	  s   €  z(_attrs_to_init_script.<locals>.<genexpr>zBaseException.__init__(self, rœ   z*, c                 S  s   g | ]	}|› d |› �‘qS )ú=r   )r™   Zkw_arg_namer   r   r   r¬   O	  s    þÿz)_attrs_to_init_script.<locals>.<listcomp>c                 s  s   � | ]
}|  d ¡d V  qdS )r
  r   N)Úsplit)r™   Zkwar   r   r   r¤   R	  s   € zself.__attrs_pre_init__(r   z
    zdef z):
    ÚpassrÉ   )rŠ   r  rÌ   r0   rˆ   r<   r   rŒ  r=   rC   r/   rB   Ú
takes_selfr5   rø  r4   Ú_INIT_FACTORY_PATÚ_get_global_namerI   r   r7   r-   Ú_first_param_typer   r=  r¶   )$rs   r   rþ   r  rï  r  r  r�   r¬  rò  rñ  r	  rÎ   Zextra_linesr  r  rÞ   Zpre_init_argsZkw_only_argsZattrs_to_validateZnames_for_globalsr   r‘   rp   rô  Zarg_nameZhas_factoryZ
maybe_selfr5   Zinit_factory_nameÚargZval_nameZinit_hash_cacheÚvalsZpre_init_kw_only_argsÚNLr   r   r   rì  _  st  ü
ÿ



ÿ
üÿ	ÿýÿ
üÿ	ÿ
ýÿ


ÿÿÿ



ÿÿÿ
üÿÿ
ÿÿ
ýÿÿ


ÿÿÿ
€


 




"ýÿÿûrì  rˆ   c                 C  s
   |   d¡S )zÅ
    The default __init__ parameter name for a field.

    This performs private-name adjustment via leading-unscore stripping,
    and is the default value of Attribute.alias if not provided.
    r  N)Úlstripr®   r   r   r   rÀ   g	  s   
rÀ   c                   @  sl   e Zd ZdZdZ										ddd„Zdd„ Ze	dddd„ƒZdd„ Z	dd„ Z
dd„ Zd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ˆ   r/   r0   r1   r8   r9   r:   r;   r3   r4   r6   r-   r5   r7   r„   r<   r=   NFc                 C  sè   t ||p||p|dƒ\}}}}t | ¡}|d|ƒ |d|ƒ |d|ƒ |d|ƒ |d|ƒ |d|ƒ |d|ƒ |d	|ƒ |d
|ƒ |d|ƒ |d|ƒ |d|	rVt t|	ƒ¡ntƒ |d|
ƒ |d|ƒ |d|ƒ |d|ƒ |d|ƒ d S )NTrˆ   r/   r0   r1   r8   r9   r:   r;   r3   r4   r5   r6   r-   r7   r„   r<   r=   )r>   r¾   r¿   ÚtypesÚMappingProxyTyperÿ   Ú_EMPTY_METADATA_SINGLETON)r   rˆ   r/   r0   r1   r2   r3   r4   r„   r6   r-   r5   r7   r8   r9   r:   r;   r<   r=   Úbound_setattrr   r   r   r  ³	  s4   ÿ











ÿû



zAttribute.__init__c                 C  s   t ‚r)   )r   rØ   r   r   r   r×   ê	  r    zAttribute.__setattr__rˆ   rN   r¨   rH   r7   rö   c                 C  s‚   |d u r|j }n|j d urd|› d�}t|ƒ‚| ||j|j|jd |j|jd|j||j|j	d u r1|n|j	|j
|j|j|j|j|jƒS )Nz>Type annotation and type argument cannot both be present for 'z'.F)r-   r@   Ú_defaultÚ
_validatorr1   r3   r4   r6   r5   r7   r8   r9   r:   r;   r<   r=   )r   rˆ   r¨   r7   r-   rJ   r   r   r   r¹   í	  s2   
îzAttribute.from_counting_attrc                 K  s   t   | ¡}| | ¡ ¡ |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
        N)ÚcopyÚ	_setattrsrµ   )r   rß   Únewr   r   r   r‰   
  s   
zAttribute.evolvec                   ó   t ‡ fdd„ˆ jD ƒƒS )ú(
        Play nice with pickle.
        c                 3  s,   � | ]}|d krt ˆ |ƒntˆ jƒV  qdS )r6   N)r‡   rÿ   r6   r1  r   r   r   r¤   %
  s
   € ÿ
ÿz)Attribute.__getstate__.<locals>.<genexpr>N©rE   r2  r   r   r   r   rû   !
  s   þzAttribute.__getstate__c                 C  s   |   t| j|ƒ¡ dS ©r  N)r  r[  r2  ©r   r\  r   r   r   rü   *
  s   zAttribute.__setstate__c                 C  sL   t  | ¡}|D ]\}}|dkr|||ƒ q|||r t t|ƒ¡ntƒ qd S )Nr6   )r¾   r¿   r  r  rÿ   r  )r   Zname_values_pairsr  rˆ   rÙ   r   r   r   r  0
  s   
ÿûüzAttribute._setattrs)
NNNFNNNNNNr)   )rˆ   rN   r¨   rH   r7   rö   )r"   r#   r$   r%   r2  r  r×   rA  r¹   r‰   rû   rü   r  r   r   r   r   r¸   r	  s,    ,
í7ÿ!	r¸   c                 C  s2   g | ]}t |td dd dd|dkddt|ƒd�‘qS )NTFr6   ©rˆ   r/   r0   r1   r2   r8   r:   r3   r4   r„   r=   ©r¸   r   rÀ   r1  r   r   r   r¬   @
  s     óõÿr¬   r×  c                 C  s   g | ]	}|j d kr|‘qS rƒ   r®   r¯   r   r   r   r¬   T
  s    c                 C  s    g | ]}|j r|jd kr|‘qS rƒ   )r3   rˆ   r¯   r   r   r   r¬   V
  s     c                   @  sn   e Zd ZdZdZg edd„ dD ƒƒ¢eddddddd	dd	ddd	dd	dd
�‘R ZdZdd„ Z	dd„ Z
dd„ ZdS )rH   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  r=   r5   rž   r8   r9   r3   r4   r7   r6   r<   r:   r;   r1   r-   c                 c  s:   � | ]}t |t|ƒtd dd ddddd dd dd d�V  qd S )NTF©rˆ   r=   r/   r0   r1   r2   r3   r4   r7   r8   r9   r:   r;   r„   r<   )r¸   rÀ   r   r1  r   r   r   r¤   v
  s*   € ïñ
ÿz_CountingAttr.<genexpr>)	rž   r  r1   r8   r:   r3   r4   r<   r=   r6   NTFr%  r   c                 C  st   t  jd7  _t j| _|| _|| _|| _|| _|| _|| _|| _	|| _
|| _|| _|| _|	| _|
| _|| _|| _d S r¥   )rH   Úcls_counterrž   r  r  r5   r1   r8   r9   r:   r;   r3   r4   r6   r-   r7   r<   r=   )r   r/   r0   r1   r2   r3   r4   r5   r6   r-   r7   r8   r9   r:   r;   r<   r=   r   r   r   r  ¨
  s"   
z_CountingAttr.__init__c                 C  s&   | j du r
|| _ |S t| j |ƒ| _ |S )zŒ
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        N)r  rG   ©r   r‚  r   r   r   r0   Í
  s
   
ÿz_CountingAttr.validatorc                 C  s    | j turt‚t|d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  N)r  r   r   rB   r'  r   r   r   r/   Û
  s   
z_CountingAttr.default)r"   r#   r$   r%   r2  rE   r¸   r‚   r&  r  r0   r/   r   r   r   r   rH   Z
  s<    îÿñá1%rH   c                   @  sL   e Zd ZdZG dd„ dejƒZG dd„ dejƒZdZdd„ Z	e
d	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                   @  s&   e Zd ZdZdZ	 dZ	 dZ	 dZdS )zClassProps.HashabilityzO
        The hashability of a class.

        .. versionadded:: 25.4.0
        ZhashableZhashable_cacheZ
unhashableZleave_aloneN)r"   r#   r$   r%   r¨  r  r©  r§  r   r   r   r   r  6  s    r  c                   @  s    e Zd ZdZdZ	 dZ	 dZdS )z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  s    r»   ©r  rþ   r  r   r7   rý   rž  r   r¡  r¢  r  r£  r¤  r  r	  rÄ   c                 C  sd   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
|| _|| _|| _|| _|| _d S r)   r*  )r   r  rþ   r  r   r7   rý   rž  r   r¡  r¢  r  r£  r¤  r  r	  rÄ   r   r   r   r  g  s    
zClassProps.__init__c                 C  s   | j tjju p| j tjju S r)   )r  rº   r  r¨  r  r   r   r   r   r«  ‹  s   þzClassProps.is_hashableN)r"   r#   r$   r%   r&   ÚEnumr  r»   r2  r  rn   r«  r   r   r   r   rº   ñ
  s    D$rº   c                 C  s.   g | ]}t |td dd dddddt|ƒd�‘qS )NTFr#  r$  r1  r   r   r   r¬   “  s     óõÿc                   @  s.   e Zd ZdZdZddd„Zdd„ Zdd	„ Zd
S )rB   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*
    ©rI   r  Fc                 C  s   || _ || _d S r)   r,  )r   rI   r  r   r   r   r  ¼  s   
zFactory.__init__c                   r  )r  c                 3  s   � | ]}t ˆ |ƒV  qd S r)   r0  r1  r   r   r   r¤   Ä  ó   € z'Factory.__getstate__.<locals>.<genexpr>Nr   r   r   r   r   rû   À  s   zFactory.__getstate__c                 C  s&   t | j|ƒD ]
\}}t| ||ƒ qdS r!  )r[  r2  r'  )r   r\  rˆ   rÙ   r   r   r   rü   Æ  s   ÿzFactory.__setstate__N)F)r"   r#   r$   r%   r2  r  rû   rü   r   r   r   r   rB   §  s    
rB   c                 C  ó(   g | ]}t |td dd dddddd�
‘qS ©NTF)
rˆ   r/   r0   r1   r2   r8   r:   r3   r4   r„   ©r¸   r   r1  r   r   r   r¬   Î  ó    ôöÿc                   @  sL   e Zd ZdZdZdddœdd„Zedd
d„ƒZddd„Zdd„ Z	d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  Z_global_namer5   Útakes_fieldr  F©r  r3  c                  sª   |ˆ _ |ˆ _|ˆ _t|ƒ}| ¡ ˆ _ˆ js ˆ js ‡ fdd„ˆ _n#ˆ jr.ˆ js.‡ fdd„ˆ _nˆ js<ˆ jr<‡ fdd„ˆ _n‡ fdd„ˆ _| ¡ }|d urS|ˆ jjd< d S d S )Nc                   s
   ˆ   | ¡S r)   ©r5   )rÙ   r  Ú__r   r   r   r¡     r§   z$Converter.__init__.<locals>.<lambda>c                   s   ˆ   | |¡S r)   r5  )rÙ   Úinstancer6  r   r   r   r¡   
  ó    ÿc                   s   ˆ   | |¡S r)   r5  )rÙ   r6  rw  r   r   r   r¡     r8  c                   s   ˆ   | ||¡S r)   r5  )rÙ   r7  rw  r   r   r   r¡     s    ÿrT   )	r5   r  r3  r   Úget_first_param_typer  r2  Úget_return_typerw   )r   r5   r  r3  ÚexÚrtr   r   r   r  ÿ  s    
ÿzConverter.__init__rp   rN   rT   c                 C  s
   d| › �S )zh
        Return the name that a converter for an attribute name *attr_name*
        would have.
        Z__attr_converter_Nr   )rp   r   r   r   r    s   
zConverter._get_global_nameró  c                 C  s‚   | j s| js|  |¡› d|› d�S | j r%| jr%|  |¡› d|› d|› d�S | j r3|  |¡› 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`.
        rá  r¾  z, self, attr_dict['z'])z, self)z, attr_dict['N)r  r3  r  )r   rp   ró  r   r   r   rù  "  s   zConverter._fmt_converter_callc                 C  s   | j | j| jdœS )zx
        Return a dict containing only converter and takes_self -- the rest gets
        computed when loading.
        ©r5   r  r3  Nr=  r   r   r   r   rû   3  s   ýzConverter.__getstate__c                 C  s   | j di |¤Ž dS )z+
        Load instance from state.
        Nr   rŸ  r"  r   r   r   rü   >  s   zConverter.__setstate__N)rp   rN   rT   rN   )rp   rN   ró  rN   rT   rN   )r"   r#   r$   r%   r2  r  rB  r  rù  rû   rü   r   r   r   r   rø  á  s    	
c                 C  r.  r/  r0  r1  r   r   r   r¬   E  r1  r=  c                   sj  t  d| ¡} t|tƒr|}nt|ttfƒrdd„ |D ƒ}nd}t|ƒ‚| dd¡}| dd¡}| dd¡}	i ‰ |dur@ˆ  |¡ |durH|ˆ d< |durP|ˆ d< |	durX|	ˆ d< t	 
| |i ‡ fd	d
„¡}
t tt¡� t d¡j dd¡|
_W d  ƒ n1 s€w   Y  | dd¡}t|| d¡| d¡dƒ\|d< |d< tdd|i|¤Ž|
ƒ}d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                 S  s   i | ]}|t ƒ “qS r   )rK   r¯   r   r   r   r-  �  r  zmake_class.<locals>.<dictcomp>z(attrs argument must be a dict or a list.rù   Nrú   r  c                   s
   |   ˆ ¡S r)   )r  )rR  ©ro   r   r   r¡   ¢  r§   zmake_class.<locals>.<lambda>r	   r"   Ú__main__r2   r8   r:   TrÁ   c                 S  s"   i | ]\}}|j d ur||j “qS r)   )r-   r*  r   r   r   r-  »  s
    ÿÿr   )ÚunicodedataÚ	normalizerC   rÿ   rD   rE   r?   Úpopr  r  Ú	new_classr#  r$  r%  r@   r8  Ú	_getframeÚ	f_globalsr�   r#   r—  rä   rµ   rw   )rˆ   rs   ÚbasesZ
class_bodyZattributes_argumentsrN  rJ   rî  rð  Z	user_initÚtype_r2   r   r   r?  r   Ú
make_classZ  sP   0

ÿÿüýÿrI  )r³  r¹  c                   @  s   e Zd ZdZeƒ Zdd„ ZdS )Ú_AndValidatorz2
    Compose many validators to a single one.
    c                 C  s   | j D ]}||||ƒ qd S r)   )Ú_validators)r   rà   rš   rÙ   r,  r   r   r   r2  Í  s   
ÿz_AndValidator.__call__N)r"   r#   r$   r%   rK   rK  r2  r   r   r   r   rJ  Å  s    rJ  c                  G  s6   g }| D ]}|  t|tƒr|jn|g¡ qtt|ƒƒS )a  
    A validator that composes multiple validators into one.

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

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

    .. versionadded:: 17.1.0
    N)rÌ   rC   rJ  rK  rE   )Z
validatorsr  r0   r   r   r   rG   Ò  s   ÿýrG   c                    sº   t dd„ ˆ D ƒƒ}|r‡ fdd„}n‡ fdd„}ˆ s(tdƒ}|j ||dœ¡ n*tˆ d ƒ ¡ }|r7||jd	< ˆ d
 }tsEt|tƒrE|j	}t|ƒ 
¡ }|rR||jd< |r[t|d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                 s  s   � | ]}t |tƒV  qd S r)   ©rC   rø  )r™   Úcr   r   r   r¤   ù  r-  zpipe.<locals>.<genexpr>c                   s,   ˆ D ]}t |tƒr|| ||ƒn|| ƒ} q| S r)   rL  )rŠ  rà   rw  rM  ©Ú
convertersr   r   Úpipe_converterý  s   ÿzpipe.<locals>.pipe_converterc                   s   ˆ D ]}|| ƒ} q| S r)   r   )rŠ  rM  rN  r   r   rP    s   
ÚA)rŠ  rT   r   rŠ  r]   rT   Tr4  N)r•  r   rw   r  r   r9  r   rC   rø  r2  r:  )rO  Zreturn_instancerP  rQ  ÚtÚlastr<  r   rN  r   rF   é  s&   


rF   )NrL   )
rM   rN   rO   rP   rQ   rR   rS   rN   rT   rU   r)   )
rM   rN   rS   rN   rO   rP   r[   rR   rT   r\   )rh   rN   ri   rj   rT   r-   )rT   r�   )rT   rr   )T)NNNNNNNFFTFFFFFNNFFNNNTNT)r   r-   rº  rN   rT   rN   )
r   r-   rs   rt   rc  rö   rd  rö   rT   r¼  )r   r-   rs   rt   )rs   rD   rT   r¼  )rT   r¼  )NN)rT   rê  r  r  )rp   rN   rÙ   rN   rô  rö   rT   rN   )rc  rö   r³  rö   r�   rv   )rs   rt   r   rö   rþ   rö   r  rö   rï  rö   r  rö   r  rö   r�   rv   r¬  rö   rò  rö   rñ  rö   r	  rN   rT   rê  )rˆ   rN   rT   rN   )lÚ
__future__r   r  r#  r  r&   r  r>  rb   r8  r  rA  r  Úcollections.abcr   r   Ú	functoolsr   Útypingr   r   r   rL   r
   r   r   r   r   r   r   r   r   Ú
exceptionsr   r   r   r   Úobjectr×   r¾   r  r|   r=  r  r  r"  rF   r  r  r
  r+  r   r   Úintr(   rK   rZ   rg   rq   rr   r}   r€   r”   r•   rÅ   rÐ   rÚ   rÜ   r‰   rá   r—  r>   r›  rs   rä   r¥  rÍ   rf  rÏ  r  r€  r‡  rÞ  rQ  rä  rÝ   rç  ré  rr  r÷  rû  rü  rý  r  rì  rÀ   r¸   r2  Z_arH   rº   Z_casrB   Z_frø  rI  rJ  rG   r   r   r   r   Ú<module>   sF   		

ñqüü
#
!
x4:    M,
ÿ
ç  



H
%
8

9.

E





/  

 Oò
þû	  #ò'ódóÿ
ÿ
k