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.ClassVarÚ_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   úJ/var/www/html/premium_crap/venv/lib/python3.10/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   Ú_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)r1   r2   r3   r4   r5   r6   r8   r/   r7   Úfactoryr9   r:   r<   r>   r?   r;   r=   Úmsgr   r   r   Úattribj   sp   :ÿÿ
ÿþýüûúùø	÷
öõôóòñðrM   Ú Ú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)rO   rQ   rS   rU   Úbytecoder   r   r   Ú_compile_and_evalØ   s   
r\   Úlocalsúdict[str, Any]c           	      C  s|   |du ri n|}d}|}	 t | ƒd|  d¡|f}tj ||¡}||kr$n|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Ú
setdefaultr\   )	rO   rU   rQ   r]   rS   ÚcountÚbase_filenameÚlinecache_tupleÚold_valr   r   r   Ú_linecache_and_compileæ   s"   
üôrk   Ú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))
    Ú
Attributesc                 S  s   | | S r*   r   )r   Úir   r   r   Úgetter  r.   z&_make_attr_tuple_class.<locals>.getter)Ú	enumerateÚpropertyr/   rG   )rl   rm   Úattr_class_nameÚbodyrp   Ú	attr_namerq   r   r   r   Ú_make_attr_tuple_class	  s   

rw   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]Úbase_attrs_mapN)r#   r$   r%   Ú__annotations__r   r   r   r   rx      s   
 rx   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_   )rP   Ú
startswithÚendswithÚ_CLASSVAR_PREFIXES)Ú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).
    )Ú__dict__)ÚclsÚ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   )
ÚreversedÚ__mro__Úgetattrr�   ÚnameÚevolveÚappendÚsetÚinsertÚadd)r‡   Útaken_attr_namesr{   Ú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Œ   )r�   r�   r‘   r’   r–   r“   )r‡   r—   r{   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__rJ   ©Ú.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¢   rv   Úca)ÚannsÚfcar9   Ú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)r9   ©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)r6   r9   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   rF   Úitemsr”   r…   r–   r¦   r   r    rJ   rM   r“   r   ÚjoinÚsortedÚ	AttributeÚfrom_counting_attrÚ
ClassPropsÚKeywordOnlyÚNOr�   rž   ÚFORCErG   r1   rB   r?   Ú_OBJ_SETATTRÚ__get__Ú_default_init_alias_forr‘   rw   r#   rx   )r‡   ÚtheseÚauto_attribsr9   Úcollect_by_mroÚfield_transformerÚca_listÚca_namesÚannot_namesrv   r/   rš   ÚunannotatedÚ	own_attrsr{   r˜   ry   Úhad_defaultrL   rm   Ú
AttrsClassr   )r²   r©   r³   r9   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È   rk   r¿   )rÖ   rØ   r‡   ÚlinesÚ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)rE   Ú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)rE   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   )	rB   rb   rA   r    Úfieldsr6   r‘   r?   r�   )	ÚargsÚchangesÚinstrL   r‡   ry   rš   rv   Ú	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Ç n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‹   Ú__attrs_props__rè   rì   TÚ__getstate__Ú__setstate__r$   r%   )9rÕ   r9   Úcollected_fields_by_mrorÍ   rÚ   Ú
is_slottedÚdictr†   rú   rö   rø   r÷   rG   rõ   r  Ú	is_frozenrü   Úhas_weakref_slotr  ÚhashabilityrÃ   ÚHashabilityÚHASHABLE_CACHEDrù   r  r�   rÿ   r  r  ÚinspectÚ	signaturerb   Ú
parametersrþ   rû   Úis_exceptionr   Úon_setattr_hookr  rý   r  rë   rí   Ú_DEFAULT_ON_SETATTRr   ÚvalidateÚconvertr2   r7   Úadded_picklingÚ_make_getstate_setstater  r  ÚhasattrÚ_add_method_dunders_saferô   Ú_add_method_dunders_unsafe)r   r‡   rÊ   rË   r	  r
  ry   r{   Úbase_mapÚpre_init_funcÚpre_init_signatureÚhas_validatorÚ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__rV   rW   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¢   Úsnippetr   r   r   rµ     ó    z0_ClassBuilder._eval_snippets.<locals>.<listcomp>ÚmethodsN)r¿   r  Úupdaterk   rÝ   rÚ   rú   )r   rO   rQ   Ú_Úsnippet_globsrS   Ú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)r2  r  Ú_create_slots_classÚweakrefÚrefrÚ   Ú__attrs_base_of_slotted__Ú_patch_original_classr   ÚabcÚupdate_abstractmethodsr�   r†   r3  )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  ƒ n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   r8  -  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<  nq%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__)rG   rõ   ©r¢   ÚkÚvr   r   r   Ú
<dictcomp>U  s
    þz5_ClassBuilder._create_slots_class.<locals>.<dictcomp>Ú_clear_type_descriptorsFr<  rè   r	   r_   rD  NTc                   ó   i | ]}|t ˆ |ƒ“qS r   ©r�   ©r¢   r‘   )r™   r   r   rH  x  s    
ÿÿÚ	__slots__r   )rD  c                 S  s"   i | ]\}}t |tƒr||j“qS r   )rE   r   Úfunc)r¢   r‘   Úcached_propr   r   r   rH  ‰  s    ýÿrÛ   c                   ó   g | ]}|ˆ vr|‘qS r   r   rL  )rC  r   r   rµ   ¨  r½   z5_ClassBuilder._create_slots_class.<locals>.<listcomp>c                   s   i | ]\}}|ˆ v r||“qS r   r   )r¢   ÚslotÚslot_descriptor)Ú
slot_namesr   r   rH  ®  s
    þc                   rP  r   r   rL  )Úreused_slotsr   r   rµ   ³  r½   r%   Ú__closure__),rú   r¾   r"  ÚsysrI  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_FIELDrG   r%   r/   r#   Ú	itertoolsÚchainÚvaluesrE   ÚclassmethodÚstaticmethodÚ__func__rs   ÚfgetÚcell_contentsrB   )r   r©   Úexisting_slotsÚweakref_inheritedÚnamesrÖ   Ú&additional_closure_functions_to_updateÚclass_annotationsr‘   rN  Ú
annotationrØ   r‡   ÚitemÚclosure_cellsÚcellÚmatchr   )r™   rC  rT  r   rS  r   r4  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_dictrQ   r   r   r   Ú_attach_reprã  ó   z,_ClassBuilder.add_repr.<locals>._attach_reprT)Ú_make_repr_scriptrö   r  r“   r  )r   ÚnsrO   rQ   rr  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__rx  )r  rB   rô   rú   )r   rL   rx  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 )rD  Nr   )r¢   Ú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                   rJ  r   rK  rL  r   r   r   rH    r½   zQ_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate.<locals>.<dictcomp>r   r   )Ústate_attr_namesr   r   Úslots_getstateþ  ó   z=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstatec                   sj   t  | ¡}t|tƒrtˆ|ƒD ]	\}}|||ƒ qnˆD ]}||v r)|||| ƒ qˆ r3|tdƒ dS dS )r{  N)rÇ   rÈ   rE   rG   Úzipr[  )r   ÚstateÚ_ClassBuilder__bound_setattrr‘   rê   ©Úhash_caching_enabledr|  r   r   Úslots_setstate  s   

ÿ€ÿz=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstate)rG   rõ   rù   )r   r}  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_hashrq  r  rS   rV   rW   c                   rn  r…  ro  )rq  rS   r   r   r   Úattach_hash*  rs  z+_ClassBuilder.add_hash.<locals>.attach_hash)rq  r  rS   r  rV   rW   )Ú_make_hash_scriptrÚ   rö   rü   rù   r  r“   )r   rO   rQ   r‹  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*  ©r~   rô   ©rq  rQ   r6   ©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   rO   rQ   r•  r   r”  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*   )r6   r9   r‘   )r¢   Úfieldr   r   r   r­   Q  s   € ýý
ÿz/_ClassBuilder.add_match_args.<locals>.<genexpr>Ú__match_args__)rG   rö   rú   r   r   r   r   Úadd_match_argsP  s   þz_ClassBuilder.add_match_argsc                   rŽ  )NTr�  c                   r‘  )NÚ__attrs_init__r’  r“  r”  r   r   Ú_attach_attrs_initg  r–  z8_ClassBuilder.add_attrs_init.<locals>._attach_attrs_initr—  )r   rO   rQ   r¡  r   r”  r   Úadd_attrs_initW  rš  z_ClassBuilder.add_attrs_initc                   s>   ˆ j }tˆ jƒ\}}‡ fdd„}ˆ j |||f¡ t|d< ˆ S )Nc                   rn  )NÚ__eq__ro  rp  r   r   r   Ú
_attach_equ  rs  z(_ClassBuilder.add_eq.<locals>._attach_eqÚ__ne__)rú   Ú_make_eq_scriptrö   r  r“   r¥  )r   r©   rO   rQ   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*   ro  )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š   r1  Únval©Úsa_attrsr   r   rè   ˜  s   ÿz._ClassBuilder.add_setattr.<locals>.__setattr__Tr<  rè   )rö   r>   r  r   ÚNO_OPr‘   rý   rB   rú   rô   r  )r   rš   r>   rL   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 )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  )rV   rW   )r¶  r   rV   r   )r#   r$   r%   r&   rM  r*  r    r2  r;  r8  r4  rv  ry  r!  r‡  r�  r™  rœ  rŸ  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.©ÚanyrB   )r4   r:   r<   Ú
default_eqrL   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)rC   )rê   r«   r   r   r   Údecide_callable_or_booleanë  s
   
ÿz>_determine_attrib_eq_order.<locals>.decide_callable_or_booleanFTr»  r¼  )	r4   r:   r<   r¾  rL   rÀ  Úcmp_keyr;   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_detectÚdundersr1   Ú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†  r0   r  r  r  r  Ú
added_init©r*  Ú
added_reprrw  Úadded_eqÚadded_ordering)r©  rª  r«  r¬  r  Úadded_match_argsr9   r  Ú	added_strr   )r  r  )r1   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‰   rB   rÆ  rÃ   r  ÚLEAVE_ALONEr  ÚHASHABLEÚ
UNHASHABLErA   rÄ   rÆ   ÚYESrÅ   Úis_hashableró   rË  rv  rÏ  ry  rÌ  r§  rÍ  r®  rµ  r�  r  r‡  rÉ  r™  r¢  r   rœ  r   rŸ  r;  )r‡   r  Úis_excÚhas_own_setattrrL   r:   r  r  rÄ   Úkwor	  Úbuilder©rË   rÃ  Úauto_excrŠ  rÌ   Úeq_rÍ   Úforce_kw_onlyr‰  Úgetstate_setstater5   r6   r9   Ú
match_argsr>   Úorder_r3   Úrepr_nsÚslotsrP   rÊ   Úweakref_slotr   r   Úwrap›  s   ÿÿÿýÿýÿþýüÿûÿøõü€óíìëêéûèá à
#û


ÿþýzattrs.<locals>.wrap)	ÚwarningsÚwarnÚDeprecationWarningr¿  rE   rF   rG   r   rH   )Ú	maybe_clsrÊ   râ  r3   r4   r5   r6   rã  r‰  rä  rP   rË   r9   rŠ  rÜ  r:   r<   rÃ  rÌ   rß  r>   rÍ   rà  Úunsafe_hashrÞ  ræ  rå  r   rÛ  r   ry   '  s$   aÿü
6 ry   c                 C  s
   | j tu S )zV
    Check whether *cls* has a frozen ancestor by looking at its
    __setattr__.
    )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%   ra   )r$   r�   r#   )r‡   rë  r   r   r   rÝ   ;  s   ÿÿrÝ   rz   r‰  r  rŠ  ú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)r5   r:   r¸   r   r   r   r­   H  s   € (ÿz$_make_hash_script.<locals>.<genexpr>ú        r5   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Ü   r;   r‘   r“   )ÚprefixÚindentrš   Úcmp_name©ry   Úclosing_bracesrQ   Ú	hash_funcÚmethod_linesÚ	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Ù   )rG   r5   rÝ   r“   r[  r¿   )r‡   ry   r‰  rŠ  ÚtabÚhash_defrý  rO   r   rø  r   rŒ  E  s>   ÿ
ÿÿ

rŒ  c                 C  s6   t | |ddd�\}}t||t| dƒd� |d | _| S )z%
    Add a hash method to *cls*.
    Frˆ  r†  ©rU   )rŒ  r\   rÝ   r†  ©r‡   ry   rO   rQ   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.
    )r£  ÚNotImplemented)r   ÚotherÚresultr   r   r   r¥  ›  s   
r¥  rF   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   )r:   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Ù   )r“   r;   r‘   r¿   )ry   rÞ   rQ   rš   r÷  rO   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   € 
ÿ)rG   r  ©ry   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.
        ©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__r   )r‡   ry   r©  rª  r«  r¬  r   )ry   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¦  r\   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)r3   r‘   r6   r¸   r   r   r   r­     s   € 
þýz$_make_repr_script.<locals>.<genexpr>c                 S  s$   i | ]\}}}|t kr|d  |“qS )Ú_repr)r3   )r¢   r‘   Úrr/  r   r   r   rH  !  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Ù   )rG   r
   r@  r   r3   r“   r¿   )ry   ru  Úattr_names_with_reprsrQ   Úattribute_fragmentsr‘   r  rp   ÚaccessorÚfragmentÚrepr_fragmentÚcls_name_fragmentrÞ   r   r   r   rt    sN   þÿÿÿý
ñrt  c                 C  s>   |du r| j }t||ƒ\}}t||t| dƒd� |d | _| S )z%
    Add a repr method to *cls*.
    Nr    r  )r‹   rt  r\   rÝ   r    )r‡   ru  ry   rO   rQ   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   rE   r/   rA   r�   r‹   r   )r‡   Úgeneric_baserL   ry   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   rH  ¥  r,  zfields_dict.<locals>.<dictcomp>)rE   r/   rA   r�   r   )r‡   rL   ry   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   Ú_run_validatorsrî   r    r2   r�   r‘   )rñ   rš   rG  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.
    rM  )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.Tr   r*  )r   Ú	attr_dictr×   )r   r´  rB   r6   r1   r   r“   r‘   r>   Ú_attrs_to_init_scriptr$   rV  Úmodulesr.  r†   rÇ   rÈ   )r‡   ry   Úpre_initÚpre_init_has_argsÚ	post_initr‰  rã  rŠ  r˜   r×  Úcls_on_setattrr�  Úhas_cls_on_setattrrL   Úneeds_cached_setattrÚfiltered_attrsr'  rš   rO   rQ   r   r   r   r   r˜  Â  sR   ÿ


€

ô

r˜  rv   Ú	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ï  r   ©rv   r1  r2  r   r   r   Ú_setattr  r~  r5  r7   Ú	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.
    r3  rþ  rï  )Ú_fmt_converter_call©rv   r1  r2  r7   r   r   r   Ú_setattr_with_converter  s   r9  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   )r5  )rv   rê   r2  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   )r9  r7  r8  r   r   r   Ú_assign_with_converter#  s   r;  rã  r˜   r|   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   rv   rP   r1  r2  r  rV   c                   s&   t | ˆ ƒrt| ||ƒS d| › d|› �S ©Nú_inst_dict['z'] = )r%  r5  r4  ©r˜   r   r   Ú
fmt_setter@  s   
z&_determine_setters.<locals>.fmt_setterr7   r6  c                   s4   |st | ˆ ƒrt| |||ƒS d| › d| | |¡› �S r<  )r%  r9  r7  r8  r>  r   r   Úfmt_setter_with_converterH  s
   ÿz5_determine_setters.<locals>.fmt_setter_with_converter)z_inst_dict = self.__dict__N©rv   rP   r1  rP   r2  r  rV   rP   ©
rv   rP   r1  rP   r2  r  r7   r6  rV   rP   )r5  r9  r:  r;  )r‰  rã  r˜   r?  r@  r   r>  r   Ú_determine_setters0  s   
ý
rC  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)rV   Nr   rN   Fr  rï  zattr_dict['z
'].defaultz=attr_dict['z=NOTHINGzif z is not NOTHING:rô  zelse:Tr   z#if _config._run_validators is True:Ú__attr_validator_Ú__attr_z(self, z, self.zself.__attrs_post_init__()r3  z', None)r=  z	'] = Nonerÿ  z = Nonerð  c                 s  s"   � | ]}|j rd |j› �V  qdS )rÿ  N)r6   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¢   Úkw_arg_namer   r   r   rµ   O	  s    þÿz)_attrs_to_init_script.<locals>.<listcomp>c                 s  s   � | ]
}|  d ¡d V  qdS )rJ  r   N)Úsplit)r¢   Úkwar   r   r   r­   R	  s   € zself.__attrs_pre_init__(r   z
    zdef z):
    ÚpassrÙ   )r“   rC  rÜ   r2   r‘   r>   r   r´  r?   rE   r1   rD   Ú
takes_selfr7   r6  r6   Ú_INIT_FACTORY_PATÚ_get_global_namerK   r   r9   r/   Ú_first_param_typer   r[  r¿   )$ry   r  r  rD  r+  rE  rF  r˜   r×  r/  r.  rG  rÞ   Úextra_linesr?  r@  rï   Úpre_init_argsÚkw_only_argsÚattrs_to_validateÚnames_for_globalsr   rš   rv   r2  Úarg_nameÚhas_factoryÚ
maybe_selfr7   Úinit_factory_nameÚargÚval_nameÚinit_hash_cacheÚvalsÚ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/  )Ú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‘   r1   r2   r3   r:   r;   r<   r=   r5   r6   r8   r/   r7   r9   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‘   r1   r2   r3   r:   r;   r<   r=   r5   r6   r7   r8   r/   r9   r�   r>   r?   )r@   rÇ   rÈ   ÚtypesÚMappingProxyTyper  Ú_EMPTY_METADATA_SINGLETON)r   r‘   r1   r2   r3   r4   r5   r6   r�   r8   r/   r7   r9   r:   r;   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‘   rP   r±   rJ   r9   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/   rB   Ú_defaultÚ
_validatorr3   r5   r6   r8   r7   r9   r:   r;   r<   r=   r>   r?   )r‡   r‘   r±   r9   r/   rL   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
        )Ú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 )r8   N)r�   r  r8   rL  r   r   r   r­   %
  s
   € ÿ
ÿz)Attribute.__getstate__.<locals>.<genexpr>©rG   rM  r   r   r   r   r  !
  s   þzAttribute.__getstate__c                 C  s   |   t| j|ƒ¡ dS ©rm  N)rj  r  rM  ©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 )Nr8   )rÇ   rÈ   rc  rd  r  re  )r   Úname_values_pairsrf  r‘   rê   r   r   r   rj  0
  s   
ÿûüzAttribute._setattrs)
NNNFNNNNNNr*   )r‘   rP   r±   rJ   r9   r  )r#   r$   r%   r&   rM  r*  rè   r_  rÂ   r’   r  r  rj  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 )NTFr8   ©r‘   r1   r2   r3   r4   r:   r<   r5   r6   r�   r?   ©rÁ   r   rÉ   rL  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Œ   )r5   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 )rJ   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.
    )rg  rh  r?   r7   r§   r:   r;   r5   r6   r9   r8   r>   r<   r=   r3   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?   r1   r2   r3   r4   r5   r6   r9   r:   r;   r<   r=   r�   r>   )rÁ   rÉ   r   rL  r   r   r   r­   v
  s*   € ïñ
ÿz_CountingAttr.<genexpr>)	r§   rg  r3   r:   r<   r5   r6   r>   r?   r8   NTFrt  r   c                 C  st   t  jd7  _t j| _|| _|| _|| _|| _|| _|| _|| _	|| _
|| _|| _|| _|	| _|
| _|| _|| _d S r®   )rJ   Úcls_counterr§   rg  rh  r7   r3   r:   r;   r<   r=   r5   r6   r8   r/   r9   r>   r?   )r   r1   r2   r3   r4   r5   r6   r7   r8   r/   r9   r:   r;   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)rh  rI   ©r   r¨  r   r   r   r2   Í
  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)rO  )rg  r   r   rD   rv  r   r   r   r1   Û
  s   
z_CountingAttr.default)r#   r$   r%   r&   rM  rG   rÁ   r‹   ru  r*  r2   r1   r   r   r   r   rJ   Z
  s<    îÿñá1%rJ   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
        ÚhashableÚhashable_cacheÚ
unhashableÚ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  r9   r  rÉ  rË  rÌ  rÍ  r  rÎ  rÏ  r   r  rÍ   c                 C  sd   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
|| _|| _|| _|| _|| _d S r*   r}  )r   r  r  r  r  r9   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Ä   rM  r*  rs   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 )NTFrr  rs  rL  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 )rD   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*
    ©rK   rO  Fc                 C  s   || _ || _d S r*   r  )r   rK   rO  r   r   r   r*  ¼  s   
zFactory.__init__c                   rl  )rm  c                 3  s   � | ]}t ˆ |ƒV  qd S r*   rK  rL  r   r   r   r­   Ä  ó   € z'Factory.__getstate__.<locals>.<genexpr>rn  r   r   r   r   r  À  s   zFactory.__getstate__c                 C  s&   t | j|ƒD ]
\}}t| ||ƒ qdS ro  )r  rM  rB  )r   r€  r‘   rê   r   r   r   r  Æ  s   ÿzFactory.__setstate__N)F)r#   r$   r%   r&   rM  r*  r  r  r   r   r   r   rD   §  s    
rD   c                 C  ó(   g | ]}t |td dd dddddd�
‘qS ©NTF)
r‘   r1   r2   r3   r4   r:   r<   r5   r6   r�   ©rÁ   r   rL  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 )r6  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__rR  Ú_global_namer7   Útakes_fieldrO  F©rO  r‡  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*   ©r7   )rê   r/  Ú__r   r   r   rª     r°   z$Converter.__init__.<locals>.<lambda>c                   s   ˆ   | |¡S r*   r‰  )rê   ÚinstancerŠ  r   r   r   rª   
  ó    ÿc                   s   ˆ   | |¡S r*   r‰  )rê   rŠ  r�  r   r   r   rª     rŒ  c                   s   ˆ   | ||¡S r*   r‰  )rê   r‹  r�  r   r   r   rª     s    ÿrV   )	r7   rO  r‡  r   Úget_first_param_typerR  r…  Úget_return_typer~   )r   r7   rO  r‡  ÚexÚrtr   r   r   r*  ÿ  s    
ÿzConverter.__init__rv   rP   rV   c                 C  s
   d| › �S )zh
        Return the name that a converter for an attribute name *attr_name*
        would have.
        Ú__attr_converter_r   )rv   r   r   r   rQ    s   
zConverter._get_global_namer1  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[')rO  r‡  rQ  )r   rv   r1  r   r   r   r7  "  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.
        ©r7   rO  r‡  r’  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Ê  rp  r   r   r   r  >  s   zConverter.__setstate__N)rv   rP   rV   rP   )rv   rP   r1  rP   rV   rP   )r#   r$   r%   r&   rM  r*  r`  rQ  r7  r  r  r   r   r   r   r6  á  s    	
c                 C  r�  r‚  rƒ  rL  r   r   r   rµ   E  r„  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   )rM   r¸   r   r   r   rH  �  r,  zmake_class.<locals>.<dictcomp>z(attrs argument must be a dict or a list.r  Nr  r*  c                   s
   |   ˆ ¡S r*   )r.  )ru  ©ru   r   r   rª   ¢  r°   zmake_class.<locals>.<lambda>r	   r#   Ú__main__r4   r:   r<   TrÊ   c                 S  s"   i | ]\}}|j d ur||j “qS r*   )r/   rE  r   r   r   rH  »  s    r   )ÚunicodedataÚ	normalizerE   r  rF   rG   rA   Úpopr.  rc  Ú	new_classr>  r?  r@  rB   rV  Ú	_getframeÚ	f_globalsr¦   r$   r¿  rö   r¾   r~   )r‘   ry   ÚbasesÚ
class_bodyÚattributes_argumentsrq  rL   r*  r,  Ú	user_initÚtype_r4   r‡   r   r”  r   Ú
make_classZ  sP   0

ÿÿüýÿr¡  )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ê   rG  r   r   r   r…  Í  s   
ÿz_AndValidator.__call__N)r#   r$   r%   r&   rM   r£  r…  r   r   r   r   r¢  Å  s    r¢  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
    )rÜ   rE   r¢  r£  rG   )Ú
validatorsr_  r2   r   r   r   rI   Ò  s   ÿýrI   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*   ©rE   r6  )r¢   Úcr   r   r   r­   ù  r€  zpipe.<locals>.<genexpr>c                   s,   ˆ D ]}t |tƒr|| ||ƒn|| ƒ} q| S r*   r¥  )r°  rñ   r�  r¦  ©Ú
convertersr   r   Úpipe_converterý  s   ÿzpipe.<locals>.pipe_converterc                   s   ˆ D ]}|| ƒ} q| S r*   r   )r°  r¦  r§  r   r   r©    s   
ÚA)r°  rV   r   r°  r_   rV   Trˆ  )r½  r   r~   r.  r   r�  r   rE   r6  r…  rŽ  )r¨  Úreturn_instancer©  rª  ÚtÚlastr�  r   r§  r   rH   é  s&   


rH   )NrN   )
rO   rP   rQ   rR   rS   rT   rU   rP   rV   rW   r*   )
rO   rP   rU   rP   rQ   rR   r]   rT   rV   r^   )rl   rP   rm   rn   rV   r/   )rV   rŠ   )rV   rx   )T)NNNNNNNFFTFFFFFNNFFNNNTNT)r‡   r/   rë  rP   rV   rP   )
r‡   r/   ry   rz   r‰  r  rŠ  r  rV   rí  )r‡   r/   ry   rz   )ry   rF   rV   rí  )rV   rí  )NN)rV   r&  rA  rB  )rv   rP   rê   rP   r2  r  rV   rP   )r‰  r  rã  r  r˜   r|   )ry   rz   r  r  r  r  rD  r  r+  r  rE  r  rF  r  r˜   r|   r×  r  r/  r  r.  r  rG  rP   rV   r&  )r‘   rP   rV   rP   )lÚ
__future__r   r9  r>  ri  r'   r  r\  rd   rV  rc  r–  r5  Úcollections.abcr   r   Ú	functoolsr   Útypingr   r   r   rN   r
   r   r   r   r   r   r   r   r   Ú
exceptionsr   r   r   r   Úobjectrè   rÇ   rP  rƒ   r[  rd  re  r=  rH   r  r  r  r~  r   r   Úintr)   rM   r\   rk   rw   rx   r…   r‰   r�   rž   rÕ   rá   rë   rí   r’   ró   r¿  r@   rÆ  ry   rö   rÐ  rÝ   rŒ  r  r¥  r¦  r­  r  rt  r  rî   r"  r%  r˜  r5  r9  r:  r;  rC  r(  rÉ   rÁ   rM  Ú_arJ   rÃ   Ú_casrD   Ú_fr6  r¡  r¢  rI   r   r   r   r   Ú<module>   sF   		

ñqüü
#
!
x4:    M,
ÿ
ç  



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




/  

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