%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/attr/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/attr/__pycache__/_make.cpython-312.pyc

�

��e#����ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZddl
mZmZmZmZddlmZmZmZmZej4ZdZdZd	Zd
Zej@i�Z!e�Z"ejFejHejJ�Z&Gd�dejN�Z(e(jRZ)	Gd
�de*�Z+e)ddddddddddddddfd�Z,dOd�Z-d�Z.d�Z/e/dgd��Z0d�Z1d�Z2d�Z3d�Z4d�Z5d�Z6d�Z7d�Z8d�Z9Gd �d!�Z:d"�Z;d#�Z<	dPd$�Z=																								dQd%�Z>e>Z?	d&�Z@d'�ZAd(�ZBd)�ZCd*�ZDd+�ZEd,�ZFdRd-�ZGd.�ZHdSd/�ZId0�ZJd1�ZKd2�Z%d3�ZLd4�ZMd5�ZNd6�ZOd7�ZPd8�ZQd9�ZRd:�ZSd;eTd<eTfd=�ZUGd>�d?�ZVeVj�D�cgc]}eV|e)ddddd|d@k7ddeU|��A��� c}ZXeCeGeIeVeX�B�eXD�cgc]}|j�dCk7s�|��c}�B�eXD�cgc]!}|j�s�|j�dCk7s� |��#c}�B�ZVGdD�dE�Z[eGeIe[��Z[GdF�dG�Z\e\j�D�cgc]}eV|e)dddddddd�H�
��c}Z]eCeGeIe\e]�B�e]�B�e]�B�Z\efdfdI�Z^e>dd�J�GdK�dL��Z_dM�Z`dN�Z#ycc}wcc}wcc}wcc}w)T�N)�
itemgetter�)�_compat�_config�setters)�PY310�PY_3_8_PLUS�_AnnotationExtractor�get_generic_base)�DefaultAlreadySetError�FrozenInstanceError�NotAnAttrsClassError�UnannotatedAttributeErrorz__attr_converter_%sz__attr_factory_%s)ztyping.ClassVarz
t.ClassVar�ClassVarztyping_extensions.ClassVar�_attrs_cached_hashc�>�eZdZdZej
�Zd�Zd�Zy)�_NothingaH
    Sentinel to indicate the lack of a value when ``None`` is ambiguous.

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

    .. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
    .. versionchanged:: 22.2.0 ``NOTHING`` is now an ``enum.Enum`` variant.
    c��y)N�NOTHING���selfs �,/usr/lib/python3/dist-packages/attr/_make.py�__repr__z_Nothing.__repr__Es���c��y)NFrrs r�__bool__z_Nothing.__bool__Hs��rN)	�__name__�
__module__�__qualname__�__doc__�enum�autorrrrrrrr8s ����d�i�i�k�G��rrc�(�eZdZdZed�dfd�Zy)�_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.
    Nrc�
�||fS�Nr)r�_none_constructor�_argss   r�
__reduce__z_CacheHashWrapper.__reduce__^s
�� �%�'�'r)rrr r!�typer*rrrr%r%Rs��	�,0��:�R�(rr%TFc��t|||d�\}}}}|�|dur|dur
d}t|��|	�8|tur
d}t|��t	|	�s
d}t|��t|	�}|�i}t
|
ttf�rtj|
�}
|rt
|ttf�rt|�}|rt
|ttf�rt|�}tdid|�d|�d	|�d
d�d|�d|�d
|�d|�d|�d|
�d|�d|�d|�d|�d|
�d|��S)a�
    Create a new attribute on a class.

    ..  warning::

        Does *not* do anything unless the class is also decorated with `attr.s`
        / `attrs.define` / and so on!

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

    :param default: A value that is used if an *attrs*-generated ``__init__``
        is used and no value is passed while instantiating or the attribute is
        excluded using ``init=False``.

        If the value is an instance of `attrs.Factory`, its callable will be
        used to construct a new value (useful for mutable data types like lists
        or dicts).

        If a default is not set (or set manually to `attrs.NOTHING`), a value
        *must* be supplied when instantiating; otherwise a `TypeError` will be
        raised.

        The default can also be set using decorator notation as shown below.

        .. seealso:: `defaults`

    :param callable factory: Syntactic sugar for
        ``default=attr.Factory(factory)``.

    :param validator: `callable` that is called by *attrs*-generated
        ``__init__`` methods after the instance has been initialized.  They
        receive the initialized instance, the :func:`~attrs.Attribute`, and the
        passed value.

        The return value is *not* inspected so the validator has to throw an
        exception itself.

        If a `list` is passed, its items are treated as validators and must all
        pass.

        Validators can be globally disabled and re-enabled using
        `attrs.validators.get_disabled` / `attrs.validators.set_disabled`.

        The validator can also be set using decorator notation as shown below.

        .. seealso:: :ref:`validators`

    :type validator: `callable` or a `list` of `callable`\ s.

    :param repr: Include this attribute in the generated ``__repr__`` method.
        If ``True``, include the attribute; if ``False``, omit it. By default,
        the built-in ``repr()`` function is used. To override how the attribute
        value is formatted, pass a ``callable`` that takes a single value and
        returns a string. Note that the resulting string is used as-is, i.e. it
        will be used directly *instead* of calling ``repr()`` (the default).
    :type repr: a `bool` or a `callable` to use a custom function.

    :param eq: If ``True`` (default), include this attribute in the generated
        ``__eq__`` and ``__ne__`` methods that check two instances for
        equality. To override how the attribute value is compared, pass a
        ``callable`` that takes a single value and returns the value to be
        compared.

        .. seealso:: `comparison`
    :type eq: a `bool` or a `callable`.

    :param order: If ``True`` (default), include this attributes in the
        generated ``__lt__``, ``__le__``, ``__gt__`` and ``__ge__`` methods. To
        override how the attribute value is ordered, pass a ``callable`` that
        takes a single value and returns the value to be ordered.

        .. seealso:: `comparison`
    :type order: a `bool` or a `callable`.

    :param cmp: Setting *cmp* is equivalent to setting *eq* and *order* to the
        same value. Must not be mixed with *eq* or *order*.

        .. seealso:: `comparison`
    :type cmp: a `bool` or a `callable`.

    :param bool | None hash: Include this attribute in the generated
        ``__hash__`` method.  If ``None`` (default), mirror *eq*'s value.  This
        is the correct behavior according the Python spec.  Setting this value
        to anything else than ``None`` is *discouraged*.

        .. seealso:: `hashing`
    :param bool init: Include this attribute in the generated ``__init__``
        method.  It is possible to set this to ``False`` and set a default
        value.  In that case this attributed is unconditionally initialized
        with the specified default value or factory.

        .. seealso:: `init`
    :param callable converter: `callable` that is called by *attrs*-generated
        ``__init__`` methods to convert attribute's value to the desired
        format.  It is given the passed-in value, and the returned value will
        be used as the new value of the attribute.  The value is converted
        before being passed to the validator, if any.

        .. seealso:: :ref:`converters`
    :param dict | None metadata: An arbitrary mapping, to be used by
        third-party components.  See `extending-metadata`.

    :param type: The type of the attribute. Nowadays, the preferred method to
        specify the type is using a variable annotation (see :pep:`526`). This
        argument is provided for backward compatibility. Regardless of the
        approach used, the type will be stored on ``Attribute.type``.

        Please note that *attrs* doesn't do anything with this metadata by
        itself. You can use it as part of your own code or for `static type
        checking <types>`.
    :param bool kw_only: Make this attribute keyword-only in the generated
        ``__init__`` (if ``init`` is ``False``, this parameter is ignored).
    :param on_setattr: Allows to overwrite the *on_setattr* setting from
        `attr.s`. If left `None`, the *on_setattr* value from `attr.s` is used.
        Set to `attrs.setters.NO_OP` to run **no** `setattr` hooks for this
        attribute -- regardless of the setting in `attr.s`.
    :type on_setattr: `callable`, or a list of callables, or `None`, or
        `attrs.setters.NO_OP`
    :param str | None alias: Override this attribute's parameter name in the
        generated ``__init__`` method. If left `None`, default to ``name``
        stripped of leading underscores. See `private-attributes`.

    .. 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*
    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.r/r0r1r2r3r5r+r4�factoryr6r7r9r;r<r8r:�msgs                  r�attribrJbs���F$>��R���$� �B���y���D��,��U�1B�F����n�����'�!�O�
��S�/�!��� �>�C��S�/�!��'�"�������*�t�U�m�,��\�\�:�.�
��Z�	�D�%�=�9��)�$�	��Z�	�D�%�=�9��)�$�	���������
�	�
���
������������������� �!�rc�8�t||d�}t|||�y)zU
    "Exec" the script with the given global (globs) and local (locs) variables.
    �execN)�compile�eval)�script�globs�locs�filename�bytecodes     r�_compile_and_evalrT9s���v�x��0�H���5�$�rc���i}d}|}	t|�d|jd�|f}tjj	||�}||k(rn|dd�d|�d�}|dz
}�Ut||||�||S)zO
    Create the method with the script given and return the method object.
    rTN����-�>)�len�
splitlines�	linecache�cache�
setdefaultrT)	�namerOrRrPrQ�count�
base_filename�linecache_tuple�old_vals	         r�_make_methodrcAs����D�
�E��M�
���K�����d�#��	
���/�/�,�,�X��G���o�%��#�C�R�(�)��5�'��3��
��
����f�e�T�8�4���:�rc���|�d�}d|�d�dg}|r,t|�D]\}}|jd|�d|�d���n|jd�ttd	�}t	d
j|�|�||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))
    �
Attributeszclass z(tuple):z    __slots__ = ()�    z% = _attrs_property(_attrs_itemgetter(�))z    pass)�_attrs_itemgetter�_attrs_property�
)�	enumerate�appendr�propertyrT�join)�cls_name�
attr_names�attr_class_name�attr_class_template�i�	attr_namerPs       r�_make_attr_tuple_classru^s���"�
�*�-�O�
��!��*�����%�j�1�	�L�A�y��&�&��y�k�!F�q�c��L�
�	�
	�"�"�:�.�",��J�E��d�i�i� 3�4�e�<���!�!r�_Attributes)�attrs�
base_attrs�base_attrs_mapc��t|�}|jd�r|jd�r|dd}|jt�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.
    )�'�"rrV)�str�
startswith�endswith�_classvar_prefixes)�annots r�
_is_class_varr��sE��
��J�E�
���
�#����z�(B��a�������.�/�/rc��t||t�}|tury|jddD]}t||d�}||us�yy)zR
    Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
    FrNT)�getattr�	_sentinel�__mro__)�cls�attrib_name�attr�base_cls�as     r�_has_own_attributer��sS���3��Y�/�D��y����K�K���O����H�k�4�0���1�9���
rc�6�t|d�r|jSiS)z$
    Get annotations for *cls*.
    �__annotations__)r�r��r�s r�_get_annotationsr��s ���#�0�1��"�"�"�
�Irc��g}i}t|jdd�D]a}t|dg�D]O}|js|j|vr�|jd��}|j
|�|||j<�Q�cg}t�}t|�D]>}|j|vr�|jd|�|j|j��@||fS)zQ
    Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
    rrV�__attrs_attrs__T��	inheritedr)
�reversedr�r�r�r^�evolverl�set�insert�add)r��taken_attr_namesrx�
base_attr_mapr�r��filtered�seens        r�_collect_base_attrsr��s����J��M��S�[�[��2�.�/�-����#4�b�9�	-�A��{�{�a�f�f�(8�8�����4��(�A����a� �$,�M�!�&�&�!�
	-�-��H��5�D�
�j�
!����6�6�T�>������1���������	��]�"�"rc��g}i}|jddD]p}t|dg�D]^}|j|vr�|jd��}|j	|j�|j|�|||j<�`�r||fS)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.
    rrVr�Tr�)r�r�r^r�r�rl)r�r�rxr�r�r�s      r�_collect_base_attrs_brokenr��s����J��M��K�K��"�%�-����#4�b�9�	-�A��v�v�)�)�����4��(�A�� � ����(����a� �$,�M�!�&�&�!�	-�-��}�$�$rc���|j�t|�}|�t|j��}�n3|du�r�j�D��	chc]\}}	t	|	t
�r|��}
}}	g}t
�}|j�D]y\}}
t|
�r�|j|��j|t�}t	|t
�s|tur
t�nt|��}|j||f��{|
|z
}t|�dkDrQtddjt!|�fd����zdz��t!d	��j�D�d
���}|D��cgc],\}}t"j%|||j|�����.}}}|r(t'||D�chc]}|j(��c}�\}}n't+||D�chc]}|j(��c}�\}}|r>|D�cgc]}|j-d����}}|D�cgc]}|j-d����}}||z}d
}d�|D�D]B}|dur"|j.turd|��}t1|��|d
us�.|j.tus�Ad}�D|�	|||�}|D�cgc]5}|j2s%|j-t5|j(���n|��7}}|D�cgc]}|j(��}}t7|j8|�}t;||�||f�Scc}	}wcc}}wcc}wcc}wcc}wcc}wcc}wcc}w)a0
    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.

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

    Return an `_Attributes`.
    T�r.rz1The following `attr.ib`s lack a type annotation: �, c�:���j|�jSr')�get�counter)�n�cds �r�<lambda>z"_transform_attrs.<locals>.<lambda>s���b�f�f�Q�i�6G�6G�r)�key�.c3�JK�|]\}}t|t�r||f���y�wr')rBrG)�.0r^r�s   r�	<genexpr>z#_transform_attrs.<locals>.<genexpr>s*����
��D�$��d�M�2��t��
�s�!#c� �|djS�Nr)r�)�es rr�z"_transform_attrs.<locals>.<lambda>"s��!�A�$�,�,�r)r^�car+)r6Fc3�\K�|]$}|jdus�|jdus�!|���&y�w)FN)r3r6�r�r�s  rr�z#_transform_attrs.<locals>.<genexpr>@s&����
M�A�!�&�&��"5�!�)�)�u�:L�a�
M�s�,�,�,zlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: )r<)�__dict__r�rC�itemsrBrGr�r�r�r�rrJrlrYrrn�sorted�	Attribute�from_counting_attrr�r^r�r�r.r?r<�_default_init_alias_forrurrv)r��these�auto_attribsr6�collect_by_mro�field_transformer�anns�ca_listr^r��ca_names�annot_namesrtr+r��unannotatedr��	own_attrsrxr�rw�had_defaultrIrp�
AttrsClassr�s                         @r�_transform_attrsr��s_���

���B��C� �D����u�{�{�}�%��	��	�!�h�h�j�
���d��$�
�.�
�
��
�
���e��#�z�z�|�	+�O�I�t��T�"���O�O�I�&����y�'�*�A��a��/� !�W��F�H�&��2C���N�N�I�q�>�*�	+���,���{��a��+�C��)�)��;�,G�H����	��
��
�"$�(�(�*�
�
'�

��%�	�
�I�r�	�$�$��r�����(;�	%�	
��I���$7��)�,�Q�!�&�&�,�%
�!�
�M�%?��)�,�Q�!�&�&�,�%
�!�
�M��5>�?��Q�X�X�d�X�+�?�	�?�6@�A��a�h�h�t�h�,�A�
�A���"�E��K�
M��
M����$��1�9�9��#7�A�BC�AF�G�C��S�/�!��%��A�I�I�W�$<��K�
��$�!�#�u�-���
�
�@A�w�w����.�q�v�v�6��7�A�M�
�E�
�#(�(�Q�!�&�&�(�J�(�'����j�A�J��
�5�)�:�}�E�F�F��o
��H��-��-��@��A��.
��)s0�L�.1L�.L"
�L'
�9L,�L1�:L6�L;c��gd�}|�|jd�n|jgd��|jddg�t|d�}|tj||d�}tdd	j
|�||�S)
N)	zdef wrapper():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,         if hasattr(super(), '__getattr__'):z.              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()r�)�cached_properties�_cached_setattr_get�_cls�original_getattr�__getattr__rj)rl�extend�_generate_unique_filename�_obj_setattr�__get__rcrn)r�r�r��lines�unique_filename�globs      r�_make_cached_property_getattrr�[s���

�E��#�
���:�	
�	���
�	
�
�L�L�$�%�	
��0��Y�?�O�/�+�3�3��,�	�D����	�	�%����	�rc�n�t|t�r|dvrtj|||�yt��)z4
    Attached to frozen classes as __setattr__.
    )�	__cause__�__context__�
__traceback__N)rB�
BaseException�__setattr__r
�rr^�values   r�_frozen_setattrsr��s:���$�
�&�4�4�,�
	�!�!�$��e�4��
�
�rc��t��)z4
    Attached to frozen classes as __delattr__.
    �r
)rr^s  r�_frozen_delattrsr��s
���
�rc��eZdZdZdZd�Zd�ZerddlZd�Z	nd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�
_ClassBuilderz(
    Iteratively build *one* class.
    )�_attr_names�_attrs�_base_attr_map�_base_names�_cache_hashr��	_cls_dict�_delete_attribs�_frozen�
_has_pre_init�_pre_init_has_args�_has_post_init�_is_exc�_on_setattr�_slots�
_weakref_slot�_wrote_own_setattr�_has_custom_setattrc��t||||||�\}}}||_|rt|j�ni|_||_|D�chc]}|j��c}|_||_td�|D��|_
||_||_||_
|	|_tt!|dd��|_d|_|j"r>|j&}t)j*|�}t-|j.�dkD|_tt!|dd��|_t|�|_|
|_||_|
|_d|_|j
|jd<|r.t<|jd<t>|jd<d	|_n�|t@tBjDtBjFfvrldx}}|D]%}|jH�d	}|jJ�d	}|s�"|s�%n|t@k(r|s|r*|tBjDk(r|r|tBjFk(r	|sd|_|r.|jM�\|jd
<|jd<yycc}w)Nc3�4K�|]}|j���y�wr'�r^r�s  rr�z)_ClassBuilder.__init__.<locals>.<genexpr>�s���� 7�A���� 7�s��__attrs_pre_init__Fr�__attrs_post_init__r�r��__delattr__T�__getstate__�__setstate__)'r�r��dictr�r�r�r^r�r�rDr�r�r�r�r��boolr�r�r�r��inspect�	signaturerY�
parametersr�r�r�r�r�r�r�r��_ng_default_on_setattrr�validate�convertr/r4�_make_getstate_setstate)rr�r��slots�frozen�weakref_slot�getstate_setstater�r6�
cache_hash�is_excr�r;�has_custom_setattrr�rwrx�base_mapr��
pre_init_func�pre_init_signature�
has_validator�
has_converters                       r�__init__z_ClassBuilder.__init__�sJ��"'7�������
'
�#��z�8���	�/4��c�l�l�+�"������,6�7�q�A�F�F�7���&��� � 7�� 7�7���������)���%���!�'�#�/C�U�"K�L���"'������ �2�2�M�!(�!2�!2�=�!A��&)�*<�*G�*G�&H�1�&L�D�#�"�7�3�0E�u�#M�N���#'��;�������%���#5�� �"'���,0�K�K����(�)��,<�D�N�N�=�)�,<�D�N�N�=�)�&*�D�#�
�"�����O�O�
�
�
-2�1�M�M��
���;�;�*�$(�M��;�;�*�$(�M� �]��
��"8�8�*�m��'�"2�"2�2�=��'�/�/�1�-�
$(�� ���,�,�.�
����~�.����~�.���s8s�Ic�6�d|jj�d�S)Nz<_ClassBuilder(cls=z)>)r�rrs rrz_ClassBuilder.__repr__s��$�T�Y�Y�%7�%7�$8��;�;rrNc��|jdur|j�S|jj|j	��S�z�
            Finalize class based on the accumulated configuration.

            Builder cannot be used after calling this method.
            T)r��_create_slots_class�abc�update_abstractmethods�_patch_original_classrs r�build_classz_ClassBuilder.build_class%sB���{�{�d�"��/�/�1�1��8�8�2�2��*�*�,��
rc�^�|jdur|j�S|j�Sr)r�rrrs rrz_ClassBuilder.build_class4s.���{�{�d�"��/�/�1�1��-�-�/�/rc���|j}|j}|jr\|jD]M}||vs�t	||t
�t
us� t
jt�5t||�ddd��O|jj�D]\}}t|||��|js+t	|dd�rd|_|jst |_|S#1swY��xYw)zA
        Apply accumulated methods and return the class.
        N�__attrs_own_setattr__F)r�r�r�r�r�r��
contextlib�suppress�AttributeError�delattrr�r��setattrr�rr�r�r�)rr��
base_namesr^r�s     rrz#_ClassBuilder._patch_original_class?s����i�i���%�%�
�����(�(�	
+���
�*���T�9�5�Y�F�
$�,�,�^�<�+���T�*�+�+�	
+� �>�>�/�/�1�	&�K�D�%��C��u�%�	&�
�&�&�7��(�%�,
�).�C�%��+�+�".����
�#+�+�s�*
C)�)C2	c���|jj�D��cic]&\}}|gt|j��d�d��vr||��(}}}|jsSd|d<|j
sB|jjD])}|jjdd�s� t|d<ni}d}|jjddD]U}|jjdd��d	}|jt|d
g�D�cic]}|t||���c}��Wt|j�}|j}	|j r$dt|jd
d�vrd|	vr|s|	dz
}	t"rH|j�D��
cic],\}}
t%|
t&j(�r
||
j*��.}}}
ni}g}|r�|	t|j-��z
}	|D]}||=�t/|j�}
|j�D]F\}}t1j2|�j4}|t0j6j8us�B||
|<�H|jd
�}|�|j;|�t=|||j�|d
<|	D�cgc]	}||vs�|��}}|j�D��cic]\}}||vr||��}}}|D�cgc]	}||vs�|��}}|j|�|j>r|j;t@�t|�|d
<|jjB|d<tE|j�|jjF|jj|�}tIjJ|jjM�|�D]�}t%|tNtPf�rt|jRdd�}n5t%|tT�rt|jVdd�}n
t|dd�}|s�i|D]%}	|jX|ju}|s�||_,�'��|Scc}}wcc}wcc}
}wcc}wcc}}wcc}w#tZ$rY�XwxYw)zL
        Build and return a new class with a `__slots__` attribute.
        r��__weakref__Frr�rrVNT�	__slots__r)r%r�r �__closure__).r�r�rDr�r�r�r��	__bases__r�r�r�r��updater�r�r�r�r	rB�	functools�cached_property�func�keysr�r�r�return_annotation�	Parameter�emptyrlr�r��_hash_cache_fieldr r+r�	itertools�chain�values�classmethod�staticmethod�__func__rm�fget�
cell_contentsr?)r�k�vr�r��existing_slots�weakref_inheritedr^r#�namesr+r��&additional_closure_functions_to_update�class_annotationsr,�
annotationr��
slot_names�slot�slot_descriptor�reused_slotsr��item�
closure_cells�cell�matchs                          rrz!_ClassBuilder._create_slots_classcs������,�,�.�
���1��M�%�� 0� 0�1�M�:�M�}�M�M�
�q�D�
��
��&�&�*/�B�&�'��+�+� $�	�	� 3� 3��H��(�(�,�,�-D�e�L�,8��=�)�����!���	�	�)�)�!�B�/�	�H�� � �$�$�]�D�9�E�$(�!��!�!�!(��+�r� B����'�(�D�1�1��
�	���)�)�*�
�� � ������W�T�Y�Y��R�%H�H��U�*�%��%�%�E��.0�X�X�Z�!�)�D�/��o�y�/H�/H�I��o�*�*�*�!��!�!#��24�.���U�,�1�1�3�4�4�E�)�
���t�H�
�!1���� ;��/�5�5�7�
9�
��d�$�.�.�t�4�F�F�
��W�%6�%6�%<�%<�<�.8�%�d�+�
9�
 "�v�v�m�4���+�6�=�=�>N�O� =�!�#3�T�Y�Y�!�B�}��(-�G�t��J�0F�d�G�
�G�*8�)=�)=�)?�
�%��o��z�!�
�/�!�
��
�
(2�N�t�T��5M�d�N�
�N�
�	�	�,��������/�0��
�+��;��!�Y�Y�3�3��>���d�4�9�9�o�d�i�i�0�0�$�)�)�2E�2E�r�J���O�O��L�L���!�#I�
�	1�D��$��l� ;�<�!(��
�
�}�d� K�
��D�(�+�!(��	�	�=�$� G�
� '��m�T� B�
� ��%�
1��1� �.�.�$�)�)�;�E�
�-0��*�
1�!	1�2�
��Y
��>��$!��JH��
��
O��J"����sA�+Q	�Q
�
1Q�	Q�%Q�>Q�	Q%� Q%�!Q*�*	Q6�5Q6c��|jt|j||j��|jd<|S)Nr)�_add_method_dunders�
_make_reprr�r�r�)r�nss  r�add_reprz_ClassBuilder.add_repr�s6��%)�%=�%=��t�{�{�B��	�	�2�&
����z�"��rc��|jjd�}|�
d}t|��d�}|j|�|jd<|S)Nrz3__str__ can only be generated if a __repr__ exists.c�"�|j�Sr'�rrs r�__str__z&_ClassBuilder.add_str.<locals>.__str__s���=�=�?�"rrR)r�r�r?rK)rr0rIrRs    r�add_strz_ClassBuilder.add_str�sO���~�~�!�!�*�-���<�G�C��S�/�!�	#�%)�$<�$<�W�$E����y�!��rc�t���td�|jD����fd�}|j���fd�}||fS)zF
        Create custom __setstate__ and __getstate__ methods.
        c3�,K�|]}|dk7s�	|���y�w)r%Nr)r��ans  rr�z8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>s����!
��R�=�-@�B�!
�s�
�c�D���D�cic]}|t||���c}Scc}w)�9
            Automatically created by attrs.
            �r�)rr^�state_attr_namess  �r�slots_getstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstates&���;K�K�$�D�'�$��-�-�K�K��Ks�c����tj|�}t|t�rt	�|�D]\}}|||��n�D]}||vs�||||���r|t
d�yy)rXN)r�r�rBrD�zipr1)r�state�_ClassBuilder__bound_setattrr^r��hash_caching_enabledrZs     ��r�slots_setstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstates����+�2�2�4�8�O��%��'�$'�'7��#?�1�K�D�%�#�D�%�0�1�-�;�D��u�}�'��e�D�k�:�;�$�� 1�4�8�$r)rDr�r�)rr[rar`rZs   @@rrz%_ClassBuilder._make_getstate_setstatesI���
!�!
��)�)�!
�
��	L� $�/�/��	9�,�~�-�-rc�$�d|jd<|S)N�__hash__)r�rs r�make_unhashablez_ClassBuilder.make_unhashable0s��%)����z�"��rc��|jt|j|j|j|j
���|jd<|S)N�rr
rc)rK�
_make_hashr�r�r�r�r�rs r�add_hashz_ClassBuilder.add_hash4sH��%)�%=�%=���	�	�����|�|��+�+�	
�&
����z�"��rc�H�|jt|j|j|j|j
|j|j|j|j|j|j|jd���|jd<|S)NF��
attrs_initr�rK�
_make_initr�r�r�r�r�r�r�r�r�r�r�r�rs r�add_initz_ClassBuilder.add_init@s���%)�%=�%=���	�	�����"�"��'�'��#�#�������� � ��#�#����� � � �

�&
����z�"�"�rc�V�td�|jD��|jd<y)Nc3�dK�|](}|jr|js|j���*y�wr')r3r6r^)r��fields  rr�z/_ClassBuilder.add_match_args.<locals>.<genexpr>Us)����1
���z�z�%�-�-�
�J�J�1
�s�.0�__match_args__)rDr�r�rs r�add_match_argsz_ClassBuilder.add_match_argsTs'��+0�1
����1
�,
����'�(rc�H�|jt|j|j|j|j
|j|j|j|j|j|j|jd���|jd<|S)NTrj�__attrs_init__rlrs r�add_attrs_initz_ClassBuilder.add_attrs_init[s���+/�+C�+C���	�	�����"�"��'�'��#�#�������� � ��#�#����� � ��

�,
����'�(�"�rc��|j}|jt|j|j��|d<|jt��|d<|S)N�__eq__�__ne__)r�rK�_make_eqr�r��_make_ne�rr�s  r�add_eqz_ClassBuilder.add_eqosN��
�^�^���/�/��T�Y�Y����,�
��8���/�/��
�;��8���rc����j}�fd�t�j�j�D�\|d<|d<|d<|d<�S)Nc3�@�K�|]}�j|����y�wr')rK)r��methrs  �rr�z*_ClassBuilder.add_order.<locals>.<genexpr>|s&�����B
��
�$�$�T�*�B
�s��__lt__�__le__�__gt__�__ge__)r��_make_orderr�r�r|s` r�	add_orderz_ClassBuilder.add_orderysL���
�^�^��B
�#�D�I�I�t�{�{�;�B
�>��8��b��l�B�x�L�"�X�,�
�rc�x��|jr|Si�|jD]C}|jxs|j}|s� |tj
us�3||f�|j<�E�s|S|jr
d}t|���fd�}d|jd<|j|�|jd<d|_|S)Nz7Can't combine custom __setattr__ with on_setattr hooks.c�h��	�|\}}||||�}t|||�y#t$r|}Y�wxYwr')�KeyErrorr�)rr^�valr��hook�nval�sa_attrss      �rr�z._ClassBuilder.add_setattr.<locals>.__setattr__�sG���
*�"�4�.���4��D�!�S�)����t�T�*���
���
�s�#�1�1Trr�)r�r�r;r�r�NO_OPr^r�r?r�rKr�)rr�r;rIr�r�s     @r�add_setattrz_ClassBuilder.add_setattr�s�����<�<��K������	1�A����9��)9�)9�J��j��
�
�=�#$�j�=����� �	1�
��K��#�#�K�C��S�/�!�	+�37����.�/�(,�(@�(@��(M����}�%�"&����rc���tjt�5|jj|_ddd�tjt�5|jj
�d|j��|_ddd�tjt�5d|jj
�d�|_ddd�|S#1swY��xYw#1swY�XxYw#1swY|SxYw)zL
        Add __module__ and __qualname__ to a *method* if possible.
        Nr�z$Method generated by attrs for class )rrr r�rr rr!)r�methods  rrKz!_ClassBuilder._add_method_dunders�s����
 �
 ��
0�	5� $�	�	� 4� 4�F��	5��
 �
 ��
0�	P�%)�Y�Y�%;�%;�$<�A�f�o�o�=N�"O�F��	P��
 �
 ��
0�	�6��9�9�)�)�*�!�-�
�N�	��
�	5�	5��	P�	P��	��
�s#�C
�+C�# C%�
C�C"�%C/)rrr r!r&rrrrrrrrNrSrrdrhrnrsrvr}r�r�rKrrrr�r��sw����I�*Z/�x<�
��	�		0�"�HP�d�
�'.�R�
��(
��(��!�Frr�c��|�t|du|duf�r
d}t|��|�||fS|�|}|�|}|dur|dur
d}t|��||fS)��
    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?)r1r7r9�
default_eqrIs     r�_determine_attrs_eq_orderr��sy��
��3��$���T�0A�B�C�6����o�����C�x��
�z�
���}���	�U�{�u��}�=����o��
�u�9�rc���|�t|du|duf�r
d}t|��d�}|�||�\}}||||fS|�|d}}n||�\}}|�||}}n||�\}}|dur|dur
d}t|��||||fS)r�Nr�c�4�t|�rd|}}||fSd}||fS)z8
        Decide whether a key function is used.
        TN)r@)r�r�s  r�decide_callable_or_booleanz>_determine_attrib_eq_order.<locals>.decide_callable_or_boolean�s1���E�?��u�3�E��c�z���C��c�z�rFTr�r�)	r1r7r9r�rIr��cmp_keyr8r:s	         rr=r=�s���
��3��$���T�0A�B�C�6����o�����1�#�6���W��G�S�'�)�)�
�z���F��/��3�
��F��}��v�y��5�e�<���y�	�U�{�u��}�=����o��
�v�u�i�'�'rc�T�|dus|dur|S|�|dur|S|D]}t||�s�y|S)ap
    Check whether we should implement a set of methods for *cls*.

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

    Return *default* if no reason for either for or against is found.
    TF)r�)r��flag�auto_detect�dundersr.�dunders      r�_determine_whether_to_implementr�sL���t�|�t�u�}����|��u�,�������c�6�*����Nrc����������	�
���
����������t|||d�\��|�|�t�ttf�rt	j
�������
���������������
��	fd�}|�|S||�S)a�4
    A class decorator that adds :term:`dunder methods` according to the
    specified attributes using `attr.ib` or the *these* argument.

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

    :param these: A dictionary of name to `attr.ib` mappings.  This is useful
        to avoid the definition of your attributes within the class body
        because you can't (e.g. if you want to add ``__repr__`` methods to
        Django models) or don't want to.

        If *these* is not ``None``, *attrs* will *not* search the class body
        for attributes and will *not* remove any attributes from it.

        The order is deduced from the order of the attributes inside *these*.

    :type these: `dict` of `str` to `attr.ib`

    :param str repr_ns: When using nested classes, there's no way in Python 2
        to automatically detect that.  Therefore it's possible to set the
        namespace explicitly for a more meaningful ``repr`` output.
    :param bool auto_detect: Instead of setting the *init*, *repr*, *eq*,
        *order*, and *hash* arguments explicitly, assume they are set to
        ``True`` **unless any** of the involved methods for one of the
        arguments is implemented in the *current* class (i.e. it is *not*
        inherited from some base class).

        So for example by implementing ``__eq__`` on a class yourself, *attrs*
        will deduce ``eq=False`` and will create *neither* ``__eq__`` *nor*
        ``__ne__`` (but Python classes come with a sensible ``__ne__`` by
        default, so it *should* be enough to only implement ``__eq__`` in most
        cases).

        .. warning::

           If you prevent *attrs* from creating the ordering methods for you
           (``order=False``, e.g. by implementing ``__le__``), it becomes
           *your* responsibility to make sure its ordering is sound. The best
           way is to use the `functools.total_ordering` decorator.


        Passing ``True`` or ``False`` to *init*, *repr*, *eq*, *order*, *cmp*,
        or *hash* overrides whatever *auto_detect* would determine.

    :param bool repr: Create a ``__repr__`` method with a human readable
        representation of *attrs* attributes..
    :param bool str: Create a ``__str__`` method that is identical to
        ``__repr__``.  This is usually not necessary except for `Exception`\ s.
    :param bool | None eq: If ``True`` or ``None`` (default), add ``__eq__``
        and ``__ne__`` methods that check two instances for equality.

        They compare the instances as if they were tuples of their *attrs*
        attributes if and only if the types of both classes are *identical*!

        .. seealso:: `comparison`
    :param bool | None order: If ``True``, add ``__lt__``, ``__le__``,
        ``__gt__``, and ``__ge__`` methods that behave like *eq* above and
        allow instances to be ordered. If ``None`` (default) mirror value of
        *eq*.

        .. seealso:: `comparison`
    :param bool | None cmp: Setting *cmp* is equivalent to setting *eq* and
        *order* to the same value. Must not be mixed with *eq* or *order*.

        .. seealso:: `comparison`
    :param bool | None unsafe_hash: If ``None`` (default), the ``__hash__``
        method is generated according how *eq* and *frozen* are set.

        1. If *both* are True, *attrs* will generate a ``__hash__`` for you.
        2. If *eq* is True and *frozen* is False, ``__hash__`` will be set to
           None, marking it unhashable (which it is).
        3. If *eq* is False, ``__hash__`` will be left untouched meaning the
           ``__hash__`` method of the base class will be used (if base class is
           ``object``, this means it will fall back to id-based hashing.).

        Although not recommended, you can decide for yourself and force *attrs*
        to create one (e.g. if the class is immutable even though you didn't
        freeze it programmatically) by passing ``True`` or not.  Both of these
        cases are rather special and should be used carefully.

        .. seealso::

           - Our documentation on `hashing`,
           - Python's documentation on `object.__hash__`,
           - and the `GitHub issue that led to the default \
             behavior <https://github.com/python-attrs/attrs/issues/136>`_ for
             more details.

    :param bool | None hash: Alias for *unsafe_hash*. *unsafe_hash* takes
        precedence.
    :param bool init: Create a ``__init__`` method that initializes the *attrs*
        attributes. Leading underscores are stripped for the argument name. If
        a ``__attrs_pre_init__`` method exists on the class, it will be called
        before the class is initialized. If a ``__attrs_post_init__`` method
        exists on the class, it will be called after the class is fully
        initialized.

        If ``init`` is ``False``, an ``__attrs_init__`` method will be injected
        instead. This allows you to define a custom ``__init__`` method that
        can do pre-init work such as ``super().__init__()``, and then call
        ``__attrs_init__()`` and ``__attrs_post_init__()``.

        .. seealso:: `init`
    :param bool slots: Create a :term:`slotted class <slotted classes>` that's
        more memory-efficient. Slotted classes are generally superior to the
        default dict classes, but have some gotchas you should know about, so
        we encourage you to read the :term:`glossary entry <slotted classes>`.
    :param bool frozen: Make instances immutable after initialization.  If
        someone attempts to modify a frozen instance,
        `attrs.exceptions.FrozenInstanceError` is raised.

        .. note::

            1. This is achieved by installing a custom ``__setattr__`` method
               on your class, so you can't implement your own.

            2. True immutability is impossible in Python.

            3. This *does* have a minor a runtime performance `impact
               <how-frozen>` when initializing new instances.  In other words:
               ``__init__`` is slightly slower with ``frozen=True``.

            4. If a class is frozen, you cannot modify ``self`` in
               ``__attrs_post_init__`` or a self-written ``__init__``. You can
               circumvent that limitation by using ``object.__setattr__(self,
               "attribute_name", value)``.

            5. Subclasses of a frozen class are frozen too.

    :param bool weakref_slot: Make instances weak-referenceable.  This has no
        effect unless ``slots`` is also enabled.
    :param bool auto_attribs: If ``True``, collect :pep:`526`-annotated
        attributes from the class body.

        In this case, you **must** annotate every field.  If *attrs* encounters
        a field that is set to an `attr.ib` but lacks a type annotation, an
        `attr.exceptions.UnannotatedAttributeError` is raised.  Use
        ``field_name: typing.Any = attr.ib(...)`` if you don't want to set a
        type.

        If you assign a value to those attributes (e.g. ``x: int = 42``), that
        value becomes the default value like if it were passed using
        ``attr.ib(default=42)``.  Passing an instance of `attrs.Factory` also
        works as expected in most cases (see warning below).

        Attributes annotated as `typing.ClassVar`, and attributes that are
        neither annotated nor set to an `attr.ib` are **ignored**.

        .. warning::
           For features that use the attribute name to create decorators (e.g.
           :ref:`validators <validators>`), you still *must* assign `attr.ib`
           to them. Otherwise Python will either not find the name or try to
           use the default value to call e.g. ``validator`` on it.

           These errors can be quite confusing and probably the most common bug
           report on our bug tracker.

    :param bool kw_only: Make all attributes keyword-only in the generated
        ``__init__`` (if ``init`` is ``False``, this parameter is ignored).
    :param bool cache_hash: Ensure that the object's hash code is computed only
        once and stored on the object.  If this is set to ``True``, hashing
        must be either explicitly or implicitly enabled for this class.  If the
        hash code is cached, avoid any reassignments of fields involved in hash
        code computation or mutations of the objects those fields point to
        after object creation.  If such changes occur, the behavior of the
        object's hash code is undefined.
    :param bool auto_exc: If the class subclasses `BaseException` (which
        implicitly includes any subclass of any exception), the following
        happens to behave like a well-behaved Python exceptions class:

        - the values for *eq*, *order*, and *hash* are ignored and the
          instances compare and hash by the instance's ids (N.B. *attrs* will
          *not* remove existing implementations of ``__hash__`` or the equality
          methods. It just won't add own ones.),
        - all attributes that are either passed into ``__init__`` or have a
          default value are additionally available as a tuple in the ``args``
          attribute,
        - the value of *str* is ignored leaving ``__str__`` to base classes.
    :param bool collect_by_mro: Setting this to `True` fixes the way *attrs*
       collects attributes from base classes.  The default behavior is
       incorrect in certain cases of multiple inheritance.  It should be on by
       default but is kept off for backward-compatibility.

       .. seealso::
          Issue `#428 <https://github.com/python-attrs/attrs/issues/428>`_

    :param bool | None getstate_setstate:
       .. note::
          This is usually only interesting for slotted classes and you should
          probably just set *auto_detect* to `True`.

       If `True`, ``__getstate__`` and ``__setstate__`` are generated and
       attached to the class. This is necessary for slotted classes to be
       pickleable. If left `None`, it's `True` by default for slotted classes
       and ``False`` for dict classes.

       If *auto_detect* is `True`, and *getstate_setstate* is left `None`, and
       **either** ``__getstate__`` or ``__setstate__`` is detected directly on
       the class (i.e. not inherited), it is set to `False` (this is usually
       what you want).

    :param on_setattr: A callable that is run whenever the user attempts to set
        an attribute (either by assignment like ``i.x = 42`` or by using
        `setattr` like ``setattr(i, "x", 42)``). It receives the same arguments
        as validators: the instance, the attribute that is being modified, and
        the new value.

        If no exception is raised, the attribute is set to the return value of
        the callable.

        If a list of callables is passed, they're automatically wrapped in an
        `attrs.setters.pipe`.
    :type on_setattr: `callable`, or a list of callables, or `None`, or
        `attrs.setters.NO_OP`

    :param callable | None field_transformer:
        A function that is called with the original class object and all fields
        right before *attrs* finalizes the class.  You can use this, e.g., to
        automatically add converters or validators to fields based on their
        types.

        .. seealso:: `transform-fields`

    :param bool match_args:
        If `True` (default), set ``__match_args__`` on the class to support
        :pep:`634` (Structural Pattern Matching). It is a tuple of all
        non-keyword-only ``__init__`` parameter names on Python 3.10 and later.
        Ignored on older Python versions.

    .. 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).
    Nc�����xst|�}�	duxrt|t�}�xrt|d�}|r|r
d}t	|��t|��|�t
|��d������
|��|�
�}t
|��d�r|j���dur|j�t
|��d�}|s|dur|j�|st
|��d�r|j�|j����durt|d	�rd
��dur�d
ur��
d}t|���d
us��|d
us|r�
rKd}t|���dus
��|dur|dur|j�n�
r
d}t|��|j�t
|��d
�r|j�n|j!��
r
d}t|��t"r�rt|d�s|j%�|j'�S)NTr�z/Can't freeze a class with a custom __setattr__.)r�r�r�rQ)rxry)r�r�r�r�rcFr-zlInvalid value for cache_hash.  To use hash caching, hashing must be either explicitly or implicitly enabled.)rzFInvalid value for cache_hash.  To use hash caching, init must be True.rr)�_has_frozen_base_class�
issubclassr�r�r?r�r�rNrSr}r�r�r>rhrdrnrvrrsr)r��	is_frozenr�has_own_setattrrI�builderr7r�r��auto_excr
r��eq_r�rr	r2r3r6�
match_argsr;�order_r0�repr_nsrr}r�rs       ���������������������r�wrapzattrs.<locals>.wrapHsL����9�4�S�9�	��T�!�D�j��m�&D��%�
�*<���+
���y�C�C��S�/�!�������+��!��0��
�
��������)
��,+���{�M�
�
���W�%��$�;��O�O��
,���k�#7�
���"��*��N�N���9����&N�
�
��������
�L��t�#�"�3�
�3��D��t���E� 1�d�6F�J�C��C�.� ��5�=�T�\�b�E�k�f��E����n�$�
�T�\��L�R�4�Z�I��,=�
�����E����n�$��#�#�%�*���{�M�
�
�����"�"�$��^����n�$�
��&�s�,<�=��"�"�$��"�"�$�$r)r�rBrCrDrrE)�	maybe_clsr�r�r0r1r2r3rrrr}r�r6r
r�r7r9r�r�r	r;r�r��unsafe_hashr�r�r�s ``` ``````````  ``````  @@rrwrwsu�����J	,�C��U�D�A�K�C�������*�t�U�m�,��\�\�:�.�
�d%�d%�d%�d%�P�����	�?�rc�&�|jtuS)zV
    Check whether *cls* has a frozen ancestor by looking at its
    __setattr__.
    )r�r�r�s rr�r��s��
�?�?�.�.�.rc
�X�d|�d|j�dt|d|j��d�S)zF
    Create a "filename" suitable for a function being generated.
    z<attrs generated � r�r rX)rr�r)r��	func_names  rr�r��s7��
�I�;�a����'7�q��3�����5�
6�a�	9�rc���	�
���
�td��D���d}t|d�}t|��
i�
d}d�d�	|s|dz
}n|dz
}|d	z
}d
�z��	dz
�	|g���	�
���
fd�}|rz�j|d
t�d�z�|r,|dt�d�|dz��j|dzdz�n|dt�d�|dz��j|dt��z�n	|d|�dj��}t
d||�
�S)Nc3�tK�|]0}|jdus|j��|jdus�-|���2y�w)TN)r2r7r�s  rr�z_make_hash.<locals>.<genexpr>�s1������A�F�F�d�N�q�v�v�~�!�$�$�$�,���s�8�8�8�        r2zdef __hash__(selfzhash((rgz):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper(�)c	�h���j||z�z|d�	�d�zg��D]u}|jrEd|j�d�}|j�|<�j|d|�d|j�d�z��T�j|d|j�d�z��w�j|dz�z�y	)
z�
        Generate the code for actually computing the hash code.
        Below this will either be returned directly or used to compute
        a value which is then cached, depending on the value of cache_hash
        r��,�_�_key�(self.�),�
        self.rfN)r�r8r^rl)
�prefix�indentr��cmp_namerw�closing_bracesrP�	hash_func�method_lines�	type_hashs
    ������r�append_hash_computation_linesz1_make_hash.<locals>.append_hash_computation_lines�s����	������)�+��8�I�;�a�0�0�
�	
��	H�A��x�x��q�v�v�h�d�+��"#�(�(��h���#�#��x��z�����x�r�B�B���#�#�F�}�Q�V�V�H�A�-F�$F�G�	H�	���F�V�O�n�<�=rzif self.z	 is None:zobject.__setattr__(self, '�', ��self.� = zreturn self.zreturn rjrc)rDr�r2rlr1rnrc)r�rwrr
�tabr��hash_defr�rOr�rPr�r�r�s `       @@@@@rrgrg�sO�������
�E��C�/��V�<�O��_�%�I��E�"�H��I��N���D����E����Y�Y��%�	�1�	��#����:�L�>�>�4����C�H�->�,?�y�"I�I�J��)�,�->�,?�s�C�S�1�W�
�
����a��#�
�.�)��)�*�#�.��a��
�	���C�L�1B�0C�"D�D�E�%�i��5�
�Y�Y�|�
$�F��
�F�O�U�C�Crc�.�t||dd��|_|S)z%
    Add a hash method to *cls*.
    Frf)rgrc�r�rws  r�	_add_hashr�s���c�5��5�I�C�L��Jrc��d�}|S)z
    Create __ne__ method.
    c�F�|j|�}|turtS|S)zj
        Check equality and either forward a NotImplemented or
        return the result negated.
        )rx�NotImplemented)r�other�results   rryz_make_ne.<locals>.__ne__#s(��
���U�#���^�#�!�!��z�rr)rys rr{r{s��
	��Mrc�r�|D�cgc]}|js�|��}}t|d�}gd�}i}|r�|jd�dg}|D]�}|jrdd|j�d�}|j||<|jd|�d|j�d	��|jd|�d
|j�d	���s|jd|j�d��|jd
|j�d����|g|�d�z
}n|jd�dj|�}t
d|||�Scc}w)z6
    Create __eq__ method for *cls* with *attrs*.
    r7)zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz
    return  (z
    ) == (r�r�r�r�r�z(other.r�r�z        other.z    )z    return Truerjrx)r7r�rlr8r^rnrc)	r�rwr�r�r�rP�othersr�rOs	         rrzrz1s=���&�1����Q�&�E�&�/��T�:�O�
�E�
�E��
���_�%�����
	:�A��x�x��q�v�v�h�d�+��#$�(�(��h�����x��z�����x�r�B�C��
�
���
�'�!�&�&���D�E����}�Q�V�V�H�A�6�7��
�
��q�v�v�h�a�8�9�
	:�	�#�6�#�7�#�#��
���&�'�
�Y�Y�u�
�F���&�/�5�A�A��C
's
�D4�D4c�����D�cgc]}|js�|��c}��fd���fd�}�fd�}�fd�}�fd�}||||fScc}w)z9
    Create ordering methods for *cls* with *attrs*.
    c�<���td��fd��D�D��S)z&
        Save us some typing.
        c3�:K�|]\}}|r||�n|���y�wr'r)r�r�r�s   rr�z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>cs'����
���s��C��J�5�(�
�s�c3�b�K�|]&}t�|j�|jf���(y�wr')r�r^r:)r�r��objs  �rr�z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>es*������89���a�f�f�%�q�{�{�3��s�,/)rD)r�rws`�r�attrs_to_tuplez#_make_order.<locals>.attrs_to_tuple_s)����
��=B��
�
�	
rc�b��|j|jur�|��|�kStS�z1
        Automatically created by attrs.
        ��	__class__r��rr�r�s  �rr�z_make_order.<locals>.__lt__j�0����?�?�d�n�n�,�!�$�'�.��*?�?�?��rc�b��|j|jur�|��|�kStSr�r�r�s  �rr�z_make_order.<locals>.__le__s�0����?�?�d�n�n�,�!�$�'�>�%�+@�@�@��rc�b��|j|jur�|��|�kDStSr�r�r�s  �rr�z_make_order.<locals>.__gt__|r�rc�b��|j|jur�|��|�k\StSr�r�r�s  �rr�z_make_order.<locals>.__ge__�r�r)r9)r�rwr�r�r�r�r�r�s `     @rr�r�YsK����)�1����Q�)�E�	
������6�6�6�)�)��c
*s�?�?c�b�|�|j}t||�|_t�|_|S)z5
    Add equality methods to *cls* with *attrs*.
    )r�rzrxr{ryr�s  r�_add_eqr��s0��
�}��#�#���#�u�%�C�J���C�J��Jrc��t|d�}td�|D��}|D���cic]\}}}|tk7s�|dz|��}}}}t|d<t|d<t
|d<g}	|D]B\}}}
|
rd|znd|zd	z}|tk(r|�d
|�d�n
|�d
|�d|�d
�}|	j
|��Ddj|	�}
|�d}n|dz}ddddddddddddd|�d|
�d�dd g}td!d"j|�||�#�Scc}}}w)$Nr0c3�K�|]I}|jdur9|j|jdurtn|j|jf���Ky�w)FTN)r0r^r3r�s  rr�z_make_repr.<locals>.<genexpr>�sC����"�
��6�6���
���!�&�&�D�.�$�a�f�f�q�v�v�>�"�s�AA�_reprrr rr�zgetattr(self, "z", NOTHING)z={z!r}z_repr(z)}r�z1{self.__class__.__qualname__.rsplit(">.", 1)[-1]}z.{self.__class__.__name__}zdef __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))rrj)rP)	r�rDr0rr rrlrnrc)rwrMr�r��attr_names_with_reprsr^�rr�rP�attribute_fragmentsrs�accessor�fragment�
repr_fragment�cls_name_fragmentr�s                rrLrL�s~��/��V�<�O�"�"��"���-B�
�
�(�d�A�q�Q�$�Y��w����
�E�
��E�)��,�E�
���E�)����+�	-�
��a���G�d�N�%6��%=�
�%M�	�
�D�y� ��*�'+�T�8�<�	�
	�"�"�8�,�	-��I�I�1�2�M�	�z�O���!=�=��	��D�"�+�D��-���-��
�)�*�!�M�?�"�=��.�
�E�$��D�I�I�e�$�o�U����U
s
�C9�C9c�F�|�|j}t|||�|_|S)z%
    Add a repr method to *cls*.
    )r�rLr)r�rMrws   r�	_add_reprr��s)��
�}��#�#���e�R��-�C�L��Jrc���t|�}|�t|t�s
d}t|��t	|dd�}|�*|�t	|dd�}|�	||_|S|�d�}t
|��|S)a*
    Return the tuple of *attrs* attributes for a class.

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

    :param type cls: Class to introspect.

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

    :rtype: 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.)rrBr+r>r�r�r)r��generic_baserIrws    r�fieldsr��s���&$�C�(�L���J�s�D�$9�.����n���C�*�D�1�E��}��#��L�*;�T�B�E�� �',��#�����8�9��"�3�'�'��Lrc��t|t�s
d}t|��t|dd�}|�|�d�}t	|��|D�cic]}|j
|��c}Scc}w)aX
    Return an ordered dictionary of *attrs* attributes for a class, whose
    keys are the attribute names.

    :param type cls: Class to introspect.

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

    :rtype: dict

    .. versionadded:: 18.1.0
    r�r�Nr�)rBr+r>r�rr^)r�rIrwr�s    r�fields_dictr�se���c�4� �.����n���C�*�D�1�E��}���8�9��"�3�'�'�$�%�!�A�F�F�A�I�%�%��%s�Ac	��tjduryt|j�D]/}|j}|��|||t||j���1y)z�
    Validate all attributes on *inst* that have a validator.

    Leaves all exceptions through.

    :param inst: Instance of a class with *attrs* attributes.
    FN)r�_run_validatorsr�r�r/r�r^)�instr�r;s   rrr%sR�����%�'��
�D�N�N�
#�.��
�K�K���=�
�d�A�w�t�Q�V�V�,�-�.rc��d|jvS)Nr&)r�r�s r�_is_slot_clsr6s���#�,�,�&�&rc�*�||vxrt||�S)z>
    Check if the attribute name comes from a slot class.
    )r)�a_namer�s  r�
_is_slot_attrr:s���]�"�J�|�M�&�4I�'J�Jrc��|
duxr|
tju}|r|r
d}
t|
��|xs|}g}i}|D]�}|js|jt
ur�"|j
|�|||j<|j�|dur
d}
t|
��d}�b|s�e|jtjus��d}��t|d�}t|||||||||	|||�\}}}|jtjvr6|jtj|jj�|jt
|d��|rt j"|d<t%|rdnd|||�}||_|S)Nz$Frozen classes can't use on_setattr.Tr3)r�	attr_dictr�rur)rr�r?r3r.rrlr^r;r��_attrs_to_init_scriptr�sys�modulesr)r�r�r�rcr�)r�rw�pre_init�pre_init_has_args�	post_initrrr
r�r�cls_on_setattrrk�has_cls_on_setattrrI�needs_cached_setattr�filtered_attrsr	r�r�rOrP�annotationsr3s                       rrmrmAs���	�d�"�J�~�W�]�]�'J���$�4����o��%�/����N��I�
�(���v�v�!�)�)�w�.�����a� ��	�!�&�&���<�<�#���~�<�� ��o�%�#'� �
�A�L�L��
�
�$E�#'� �(� 0��V�<�O�!6���
����������
"��F�E�;��~�~����$�
���S�[�[����0�9�9�:�	�L�L�W�9�=�>��(4�';�';��#�$��&��J���
�	�D�'�D���Krc��d|�d|�d�S)zJ
    Use the cached object.setattr to set *attr_name* to *value_var*.
    �
_setattr('r�r�r�rt�	value_var�has_on_setattrs   r�_setattrr�s���	�{�#�i�[��2�2rc�*�d|�dt|fz�d|�d�S)zk
    Use the cached object.setattr to set *attr_name* to *value_var*, but run
    its converter first.
    rr�r�rg)�_init_converter_patrs   r�_setattr_with_converterr�s��	��y�l�*���rc�0�|r
t||d�Sd|�d|��S)zo
    Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
    relegate to _setattr.
    Tr�r�)r)rtr�rs   r�_assignr�s)��
��	�5�$�/�/�
�9�+�S���(�(rc�H�|r
t||d�Sd|�dt|fz�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�r�r�)rrrs   r�_assign_with_converterr!�s7��
�&�y�)�T�B�B��	��y�l�*���rc
�^
��g}|r|jd�|	r|jd�|dur-|dur
t}
t}n(|jd��fd�}
�fd�}nt}
t}g}g}g}i}ddi}|D�]�}|j
r|j|�|j}|jduxs |jtjuxr|
}|j}t|jt�}|r|jjrd	nd
}|jdu�r|r�t |jfz}|j"�D|j|||d|�d
�z|��t$|jfz}|j"||<n |j|
||d|�d
�z|��|jj&||<�n�|j"�B|j||d|�d�|��t$|jfz}|j"||<�n�|j|
|d|�d�|���n�|jt(ur�|s�|�d|�d�}|j*r|j|�n|j|�|j"�<|j||||��|j"|t$|jfz<�n�|j|
|||���n�|�rI|�d�}|j*r|j|�n|j|�|jd|�d��t |jfz}|j"�t|jd||||�z�|jd�|jd|||dz|zd
z|�z�|j"|t$|jfz<nR|jd|
|||�z�|jd�|jd|
||dz|zd
z|�z�|jj&||<n�|j*r|j|�n|j|�|j"�;|j||||��|j"|t$|jfz<n|j|
|||��|jdus��U|j,�|j"�|j,||<��~|j"����t/|j"�j1�}|s���|||<���|rxt2|d<|jd�|D]Y}d|jz}d|jz}|jd|�d|�d|j�d
��|j
||<|||<�[|r|jd�|r&|r|rd}nd}nd}|j|t4d fz�|r-d!j7d"�|D��} |jd#| �d
��d$j7|�}|}!|rO||rd$nd
�d%d$j7|���z
}d$j7|D�"cgc]	}"|"�d&|"����c}"�}#|!|!rd$nd
z
}!|!|#z
}!|r
|rd'|!z|d(<d)|rd*nd+�d|�d,|rd-j7|�nd.�d/�||fScc}"w)0z�
    Return a script of an initializer for *attrs* and a dict of globals.

    The globals are expected by the generated script.

    If *frozen* is True, we cannot set the attributes directly so we use
    a cached ``object.__setattr__``.
    zself.__attrs_pre_init__()z$_setattr = _cached_setattr_get(self)Tz_inst_dict = self.__dict__c�F��t|��r
t|||�Sd|�d|��S)N�_inst_dict['�'] = )rr�rtrrr�s   �r�
fmt_setterz)_attrs_to_init_script.<locals>.fmt_setter�s/��� ��M�:�#�I�y�.�I�I�%�i�[��i�[�A�Arc�b��|st|��r
t|||�Sd|�dt|fz�d|�d�S)Nr$r%r�r�)rrrr&s   �r�fmt_setter_with_converterz8_attrs_to_init_script.<locals>.fmt_setter_with_converter�sG���"�]�9�m�%L�2�!�9�n���&M��'�9�,�6���r�returnNr�Fr�r�zattr_dict['z
'].defaultz=attr_dict['z=NOTHINGzif z is not NOTHING:rfzelse:rz#if _config._run_validators is True:�__attr_validator_�__attr_z(self, z, self.zself.__attrs_post_init__()z_setattr('%s', %s)z_inst_dict['%s'] = %szself.%s = %s�Noner�c3�TK�|] }|js�d|j�����"y�w)r�N)r3r^r�s  rr�z(_attrs_to_init_script.<locals>.<genexpr>�	s!����B�Q�1�6�6�%����x�(�B�s�(�(zBaseException.__init__(self, r�z*, �=zself.__attrs_pre_init__(%s)rzdef rurz):
    z
    �passrj)rlrrrr!r/r^r;rr�r<rBr.rA�
takes_selfr3�_init_factory_patr4rrHrr6r+r
�get_first_param_typerr1rn)$rwrrr
rrr
r�rrrrkr�r'r)�args�kw_only_args�attrs_to_validate�names_for_globalsrr�rtr�arg_name�has_factory�
maybe_self�init_factory_name�	conv_name�arg�t�val_name�init_hash_cache�vals�
pre_init_args�kw_arg�pre_init_kw_only_argss$       `                            rr
r
�s����,
�E��
���0�1��
���
3�		
���~��D�=�!�J�(?�%�
�L�L�5�6�
B�
� �
�$:�!�
�D��L������T�"�K�
�M.���;�;��$�$�Q�'��F�F�	����T�1�
�
�L�L��
�
�-�D�2D�	�
�7�7�� ����G�4��*�q�y�y�/C�/C�V��
��6�6�U�?��$5����	�$A�!��;�;�*��L�L�1�%�-�!�J�<�q�0A�A�*���!4�q�v�v�i� ?�I�34�;�;�%�i�0��L�L�"�%�-�!�J�<�q�0A�A�*���89�y�y�7H�7H�!�"3�4����(����-�!�%�i�[�
�;�&���0�1�6�6�)�;�	�/0�{�{�!�)�,�����!�%�i�[�
�;�&����Y�Y�g�
%�k��J�l�9�+�Z�@�C��y�y��#�#�C�(����C� ��{�{�&����-�!�8�^����K�K�"�'�1�6�6�)�3�����Z�	�8�^�L�M�
��J�h�'�C��y�y��#�#�C�(����C� ��L�L�3�x�j�(8�9�:� 1�Q�V�V�I� =���{�{�&�����/�!�8�^�������W�%�����/�!�)�C�/�*�<�s�B�&�����K�K�"�'�1�6�6�)�3������Z�	�8�^�L�L�����W�%����� �!�)�C�/�*�<�s�B�&����45�9�9�3D�3D��/�0��y�y��#�#�H�-����H�%��{�{�&����-�!�8�^����K�K�"�'�1�6�6�)�3�����Z�	�8�^�L�M��6�6�T�>��v�v�!�a�k�k�&9�()����H�%����(�(����5�J�J�L���,-�K��)�[M.�^�'.��)�$�
���:�;�"�	-�A�*�Q�V�V�3�H�!�A�F�F�*�I��L�L�4��z����7�1�6�6�(�!�L�M�*+�+�+��h�'�+,��i�(�	-��
���1�2����"6��#:��,�O�
���_�(9�6�'B�B�C���x�x�B�%�B�B��
���4�T�F�!�<�=��9�9�T�?�D��M����D�b� ��I�I�l�#�
�	
��!%�	�	�6B�C�F���
'�C�!
��	�!�D�r�	
�
�	�.�.�
��%�0�=�@��a���
",�
��
;��$)�H�M�M�%� �v�5�		
�	��	�	��
Ds�Z*r^r*c�$�|jd�S)z�
    The default __init__ parameter name for a field.

    This performs private-name adjustment via leading-unscore stripping,
    and is the default value of Attribute.alias if not provided.
    r�)�lstripr�s rr�r��	s���;�;�s��rc�`�eZdZdZdZ										dd�Zd�Zedd��Zd�Z	d�Z
d	�Zd
�Zy)
r�a�
    *Read-only* representation of an attribute.

    .. warning::

       You should never instantiate this class yourself.

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

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

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

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


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

    For the full version history of the fields, see `attr.ib`.
    )r^r.r/r0r7r8r9r:r2r3r5r+r4r6r�r;r<Nc���t||xs|
|xs|d�\}
}}}tj|�}|d|�|d|�|d|�|d|�|d|
�|d|�|d|�|d	|�|d
|�|d|�|d|�|d
|	rtjt|	��nt�|d|
�|d|�|d|�|d|�|d|�y)NTr^r.r/r0r7r8r9r:r2r3r4r5r+r6r�r;r<)r=r�r��types�MappingProxyTyper��_empty_metadata_singleton)rr^r.r/r0r1r2r3r�r5r+r4r6r7r8r9r:r;r<�
bound_setattrs                    rrzAttribute.__init__*
s��*(B����2�y�1�E�4�(
�$��F�E�9�
%�,�,�T�2�
�	�f�d�#��i��)��k�9�-��f�d�#��d�B���h��'��g�u�%��k�9�-��f�d�#��f�d�#��k�9�-�����&�&�t�H�~�6�.�	
�	�f�d�#��i��)��k�9�-��l�J�/��g�u�%rc��t��r'r�r�s   rr�zAttribute.__setattr__a
s��!�#�#rc
��|�
|j}n|j�
d}t|��tjD�cic]}|dvr
|t	||���}}|d||j
|j|ddd�|��Scc}w)Nz8Type annotation and type argument cannot both be present)r^r/r.r+r�F)r^r/r.r+r1r�r)r+r?r�r&r��
_validator�_default)r�r^r�r+rIr:�	inst_dicts       rr�zAttribute.from_counting_attrd
s����<��7�7�D�
�W�W�
 �L�C��S�/�!��(�(�
�����
�w�r�1�~��
�	�
��
���m�m��K�K����

��
�	
��
s�A8c�n�tj|�}|j|j��|S)z�
        Copy *self* and apply *changes*.

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

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

        .. versionadded:: 20.3.0
        )�copy�	_setattrsr�)r�changes�news   rr�zAttribute.evolve�
s(���i�i��o���
�
�g�m�m�o�&��
rc�@��t�fd��jD��S)�(
        Play nice with pickle.
        c3�j�K�|]*}|dk7rt�|�nt�j����,y�w)r5N)r�r�r5�r�r^rs  �rr�z)Attribute.__getstate__.<locals>.<genexpr>�
s5�����
��$(�:�#5�G�D�$��4��
�
�;N�N�
�s�03�rDr&rs`rr�zAttribute.__getstate__�
s#����
����
�
�	
rc�N�|jt|j|��y�rYN)rUr]r&)rr^s  rr�zAttribute.__setstate__�
s��	
���s�4�>�>�5�1�2rc	��tj|�}|D]A\}}|dk7r
|||��|||rtjt	|��nt
��Cy)Nr5)r�r�rJrKr�rL)r�name_values_pairsrMr^r�s     rrUzAttribute._setattrs�
s\��$�,�,�T�2�
�,�		�K�D�%��z�!��d�E�*�����*�*�4��;�7�2�	�			r)
NNNFNNNNNNr')
rrr r!r&rr�r5r�r�r�r�rUrrrr�r��	sb��)�V�I�<�
���������'5&�n$��
��
�<�$
�3�rr�r5)r^r.r/r0r1r7r9r2r3r�r<)rwr�c�|�eZdZdZdZged�dD���eddddddddddddddd�	���Zd
Zd�Z	d�Z
d
�Zy)rGa
    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�rQr0r7r8r9r:r2r3r5rPr4r+r6r;r<c#�jK�|]+}t|t|�tdddddddddddd�����-y�w)NTF�r^r<r.r/r0r1r2r3r6r7r8r9r:r�r;)r�r�r)r�r^s  rr�z_CountingAttr.<genexpr>�
sV����
�$�#
��-�d�3��������������
�
�
�s�13)	r�rQr0r7r9r2r3r;r<r5NTFrcrc�2�txjdz
c_tj|_||_||_||_||_||_||_|
|_	||_
||_||_||_
|	|_|
|_||_||_yr�)rG�cls_counterr�rQrPr4r0r7r8r9r:r2r3r5r+r6r;r<)rr.r/r0r1r2r3r4r5r+r6r7r8r9r:r;r<s                 rrz_CountingAttr.__init__s���&	�!�!�Q�&�!�$�0�0�����
�#���"�����	���������
�"�����	���	� ��
���	����$�����
rc�f�|j�	||_|St|j|�|_|S)z�
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        )rPrF�rr�s  rr/z_CountingAttr.validator?s5���?�?�"�"�D�O���#�4�?�?�D�9�D�O��rc�b�|jtur
t��t|d��|_|S)z�
        Decorator that allows to set the default for an attribute.

        Returns *meth* unchanged.

        :raises DefaultAlreadySetError: If default has been set before.

        .. versionadded:: 17.1.0
        T)r2)rQrrrArgs  rr.z_CountingAttr.defaultMs,���=�=��'�(�*�*����6��
��r)rrr r!r&rDr�r�rerr/r.rrrrGrG�
s�����I�$0�	�
�$
�%
�

�0�>	����������������	
�?0�O�b�K�#�J�rrGc�(�eZdZdZdZdd�Zd�Zd�Zy)rAa�
    Stores a factory callable.

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

    :param callable factory: A callable that takes either none or exactly one
        mandatory positional argument depending on *takes_self*.
    :param bool takes_self: Pass the partially initialized instance that is
        being initialized as a positional argument.

    .. versionadded:: 17.1.0  *takes_self*
    �rHr2c� �||_||_yr'rj)rrHr2s   rrzFactory.__init__ss�����$��rc�@��t�fd��jD��S)rYc3�6�K�|]}t�|����y�wr'rYr[s  �rr�z'Factory.__getstate__.<locals>.<genexpr>{s�����D�T�W�T�4�(�D�s�r\rs`rr�zFactory.__getstate__ws����D�T�^�^�D�D�Drc�Z�t|j|�D]\}}t|||��yr^)r]r&r")rr^r^r�s    rr�zFactory.__setstate__}s.���t�~�~�u�5�	'�K�D�%��D�$��&�	'rN)F)rrr r!r&rr�r�rrrrArAbs���*�I�%�E�'rrA)
r^r.r/r0r1r7r9r2r3r�c�$�
�t|t�r|}n<t|ttf�r|D�cic]
}|t	���}}n
d}t|��|j
dd�}|j
dd�}	|j
dd�}
i�
|��
j|�|�|�
d<|	�|	�
d<|
�|
�
d<tj||i�
fd��}tjtt�5tjd�j j#dd	�|_ddd�|j
d
d�}t'||j#d�|j#d�d
�\|d<|d<t)dd|i|��|�Scc}w#1swY�hxYw)ap
    A quick way to create a new class called *name* with *attrs*.

    :param str name: The name for the new class.

    :param attrs: 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.
    :type attrs: `list` or `dict`

    :param tuple bases: Classes that the new class will subclass.

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

    :param attributes_arguments: Passed unmodified to `attr.s`.

    :return: A new class with *attrs*.
    :rtype: type

    .. versionadded:: 17.1.0 *bases*
    .. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained.
    .. versionchanged:: 23.2.0 *class_body*
    z(attrs argument must be a dict or a list.r�Nr�rc�&��|j��Sr')r))rM�bodys �rr�zmake_class.<locals>.<lambda>�s����	�	�$��rrr�__main__r1r7r9Tr�r)rBr�rCrDrJr>�popr)rJ�	new_classrrr r?r�	_getframe�	f_globalsr�rr�r�)r^rw�bases�
class_body�attributes_arguments�cls_dictr�rIr
r�	user_init�type_r1rqs             @r�
make_classr}�s����:�%�����	�E�D�%�=�	)�).�/�A�A�v�x�K�/��/�8����n���|�|�0�$�7�H����2�D�9�I����Z��.�I�
�D������J����%-��
!�"���&/��
"�#���$��Z���O�O�D�%��-G�H�E�
�	�	�^�Z�	8�
��=�=��+�5�5�9�9��
�
���
��
"�
"�5�$�
/�C�	"��� � ��&�� � ��)��		���T�"��W�%�:�6�9��9�$8�9�%�@�@��U0�2
�
�s�F�*5F�F)rr2c�$�eZdZdZe�Zd�Zy)�
_AndValidatorz2
    Compose many validators to a single one.
    c�:�|jD]}||||��yr')�_validators)rrr�r�r;s     r�__call__z_AndValidator.__call__�s#���!�!�	!�A�
�d�D�%� �	!rN)rrr r!rJr�r�rrrrr�s����(�K�!rrc��g}|D]0}|jt|t�r|jn|g��2tt	|��S)z�
    A validator that composes multiple validators into one.

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

    :param callables validators: Arbitrary number of validators.

    .. versionadded:: 17.1.0
    )r�rBrr�rD)�
validatorsrBr/s   rrFrF�sO���D��
�	�����)�]�3�
�!�!���	
�
���t��%�%rc����fd�}�s!tjd�}||d�|_|St�d�j	�}|r||jd<t�d�j�}|r||jd<|S)aY
    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.

    :param callables converters: Arbitrary number of converters.

    .. versionadded:: 20.1.0
    c�&���D]
}||�}�|Sr'r)r�r4�
converterss  �r�pipe_converterzpipe.<locals>.pipe_converters"���#�	!�I��C�.�C�	!��
r�A)r�r*rr�rVr*)�typing�TypeVarr�r
r4�get_return_type)r�r�r�r?�rts`    rrErEs�������N�N�3���12�a�)@��&���
!��A��/�D�D�F���45�N�*�*�5�1�"�*�R�.�
1�
A�
A�
C��
�79�N�*�*�8�4��r)Nr+)T)NNNNNNNFFTFFFFFNNFFNNNTNr')NN)arrTr"r*r�r2r[rrJr��operatorrr+rrrrr	r
r�
exceptionsrr
rr�objectr�r�rr3r�r1rKrLr�rErrr�Enumrr�intr%rJrTrcrurvr�r�r�r�r�r�r�r�r�r�r�r=r�rwr�r�r�rgr�r{rzr�r�rLr�r�r�rrrmrrrr!r
r}r�r�r&�_ar^r2rGrA�_fr}rrF)r^r�s00r�<module>r�s����������
��
��(�'������!�!��+��'����)��2�E�2�2�2�6��
�H�	�%����g�o�o�w�7G�7G�H���t�y�y��(�
�
���

(��
(�"
��	
��	
�	
�
�	
�����
��
�T�n ��:"�:%���
��0�"
� �#�>%�8jG�Z5�p � �M�M�`�8((�X.2��6�
��	
��	
�	
�
���
����
��
��������1Y�x
���/��DD�N��&%B�P5*�p
�6�r�'�T&�2.�"'�K�L�^3�	�)��_�D	�#��#��E�E�l�#�#��	
��
���
�����j� �
��%�d�+����"
���)�2�&��6�Q����+� 5�q�6���
=��A�F�F�q�v�v��'<�1�
=�
�	�P�P�f�	�-�0�1�
� '� '�`�!�!��	
��
���
����
�
����� �G�I�g�R�8��C�2�
N���y�T�JA�b�T���	!�	!��	!�&�*$��s
��(7��
=��zs*�*#J>�!K�6K�K
�K
�'K
�#K


Zerion Mini Shell 1.0