Your IP : 3.139.70.69


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/attr/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/attr/__pycache__/_make.cpython-311.pyc

�

Q�Dg�z���ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZddl	mZm
Z
mZmZddlmZmZmZmZejZdZdZd	Zd
Zeji��Ze��Zejej ej!��Z"Gd�dej#��Z$e$j%Z%	Gd
�de&��Z'e%ddddddddddddddfd�Z(dOd�Z)d�Z*d�Z+e+dgd���Z,d�Z-d�Z.d�Z/d�Z0d�Z1d�Z2d�Z3d�Z4Gd �d!��Z5d"�Z6d#�Z7	dPd$�Z8																								dQd%�Z9e9Z:	d&�Z;d'�Z<d(�Z=d)�Z>d*�Z?d+�Z@d,�ZAdRd-�ZBd.�ZCdSd/�ZDd0�ZEd1�ZFd2�Z!d3�ZGd4�ZHd5�ZId6�ZJd7�ZKd8�ZLd9�ZMd:�ZNd;eOd<eOfd=�ZPGd>�d?��ZQd@�eQjRD��ZSe>eBeDeQeS�A��dB�eSD���A��dC�eSD���A��ZQGdD�dE��ZTeBeDeT����ZTGdF�dG��ZUdH�eUjRD��ZVe>eBeDeUeV�A��eV�A��eV�A��ZUeffdI�ZWe9dd�J��GdK�dL����ZXdM�ZYdN�ZdS)T�N)�
itemgetter�)�_compat�_config�setters)�PY310�_AnnotationExtractor�get_generic_base�set_closure_cell)�DefaultAlreadySetError�FrozenInstanceError�NotAnAttrsClassError�UnannotatedAttributeErrorz__attr_converter_%sz__attr_factory_%s)ztyping.ClassVarz
t.ClassVar�ClassVarztyping_extensions.ClassVar�_attrs_cached_hashc�<�eZdZdZej��Zd�Zd�ZdS)�_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��dS)N�NOTHING���selfs �j/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/attr/_make.py�__repr__z_Nothing.__repr__As���y�c��dS)NFrrs r�__bool__z_Nothing.__bool__Ds���urN)	�__name__�
__module__�__qualname__�__doc__�enum�autorrrrrrrr4sK���������d�i�k�k�G��������rrc�0�eZdZdZed��dfd�ZdS)�_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__Zs
�� �%�'�'r)rrr r!�typer*rrrr%r%NsA������	�	�,0�4��:�:�R�(�(�(�(�(�(rr%TFc�\�t|||d��\}}}}|�|dur|durtd���|	�E|turtd���t	|	��std���t|	��}|�i}t
|
ttf��rtj
|
�}
|r%t
|ttf��r	t|�}|r%t
|ttf��r	t|�}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` / et cetera!

    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.

    :type default: Any value

    :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.

    :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.
    :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.
    :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*.
    :type cmp: a `bool` or a `callable`.

    :param Optional[bool] 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*.
    :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.
    :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.
    :param 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 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 Optional[str] 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:s                 r�attribrI^s��p$>��R���$�$� �B���y���D��,�,��U�1B�1B��D�
�
�	
����'�!�!�����
��� � �	K��I�J�J�J��'�"�"�������*�t�U�m�,�,�/��\�:�.�
��%�Z�	�D�%�=�9�9�%��)�$�	��%�Z�	�D�%�=�9�9�%��)�$�	���������)���T��
�D�	�
�T���T�
��)������T������2���v���e���)���:�� �e�!�r�c�J�t||d��}t|||��dS)zU
    "Exec" the script with the given global (globs) and local (locs) variables.
    �execN)�compile�eval)�script�globs�locs�filename�bytecodes     r�_compile_and_evalrT*s-���v�x��0�0�H���5�$�����rc�
�i}d}|}	t|��d|�d��|f}tj�||��}||krn|dd��d|�d�}|dz
}�ct||||��||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_methodrc2s����D�
�E��M����K�K�����d�#�#��	
���/�,�,�X��G�G���o�%�%��'����,�7�7�u�7�7�7�H��Q�J�E���f�e�T�8�4�4�4���:�rc�"�|�d�}d|�d�dg}|r2t|��D]!\}}|�d|�d|�d����"n|�d��ttd	�}t	d
�|��|��||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_classruOs���"�-�-�-�O�*��*�*�*�����/�%�j�1�1�	�	�L�A�y��&�&�L�y�L�L�q�L�L�L�
�
�
�
�	�
	�"�"�:�.�.�.�",��J�J�E��d�i�i� 3�4�4�e�<�<�<���!�!r�_Attributes)�attrs�
base_attrs�base_attrs_mapc��t|��}|�d��r|�d��r
|dd�}|�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.
    )�'�"rrV)�str�
startswith�endswith�_classvar_prefixes)�annots r�
_is_class_varr�ys\��
��J�J�E�
���
�#�#�����z�(B�(B���a��d������.�/�/�/rc��t||t��}|turdS|jdd�D]}t||d��}||urdS�dS)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��sk���3��Y�/�/�D��y����u��K����O�����H�k�4�0�0���1�9�9��5�5���4rc�4�t|d��r|jSiS)z$
    Get annotations for *cls*.
    �__annotations__)r�r��r�s r�_get_annotationsr��s%���#�0�1�1�#��"�"�
�Irc��g}i}t|jdd���D]\}t|dg��D]H}|js	|j|vr�|�d���}|�|��|||j<�I�]g}t��}t|��D]<}|j|vr�|�d|��|�	|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�9�	-�	-�A��{�
�a�f�(8�8�8�����4��(�(�A����a� � � �$,�M�!�&�!�!�
	-��H��5�5�D�
�j�
!�
!�����6�T�>�>������1��������������]�"�"rc��g}i}|jdd�D]o}t|dg��D][}|j|vr�|�d���}|�|j��|�|��|||j<�\�p||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��"��%�-�-����#4�b�9�9�	-�	-�A��v�)�)�)�����4��(�(�A�� � ���(�(�(����a� � � �$,�M�!�&�!�!�	-��}�$�$rc
�L���|j�t|���|� d�|���D��}�nb|du�r/d�����D��}g}t��}����D]�\}	}
t	|
��r�|�|	����|	t��}t|t��s(|turt��}nt|���}|�|	|f����||z
}t|��dkr:tdd�t|�fd	��
����zdz���n.td�����D��d
��
��}�fd�|D��}
|rt!|d�|
D����\}}nt#|d�|
D����\}}|rd�|
D��}
d�|D��}||
z}d}d�|D��D]:}|dur |jturt'd|�����|dur|jturd}�;|�|||��}d�|D��}d�|D��}t)|j|��}t-||��||f��S)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`.
    Nc��g|]	\}}||f��
Srr)�.0r^�cas   r�
<listcomp>z$_transform_attrs.<locals>.<listcomp>�s ��<�<�<�(�$��D�"�:�<�<�<rTc�B�h|]\}}t|t���|��Sr�rBrG�r�r^r�s   r�	<setcomp>z#_transform_attrs.<locals>.<setcomp>�s<��
�
�
���d��$�
�.�.�
��
�
�
r�r.rz1The following `attr.ib`s lack a type annotation: �, c�8����|��jSr')�get�counter)�n�cds �r�<lambda>z"_transform_attrs.<locals>.<lambda>s���b�f�f�Q�i�i�6G�r)�key�.c3�NK�|] \}}t|t���||fV��!dSr'r�r�s   r�	<genexpr>z#_transform_attrs.<locals>.<genexpr>sN����
�
��D�$��d�M�2�2�
��t��
�
�
�
�
�
rc��|djS�Nr)r�)�es rr�z"_transform_attrs.<locals>.<lambda>s��!�A�$�,�rc	�v��g|]5\}}t�||��|�������6S))r^r�r+)�	Attribute�from_counting_attrr�)r�rtr��annss   �rr�z$_transform_attrs.<locals>.<listcomp>sW������
�I�r�	�$�$��r�����(;�(;�	%�	
�	
���rc��h|]	}|j��
Sr�r^�r�r�s  rr�z#_transform_attrs.<locals>.<setcomp>"���,�,�,�Q�!�&�,�,�,rc��h|]	}|j��
Srr�r�s  rr�z#_transform_attrs.<locals>.<setcomp>&r�rc�:�g|]}|�d�����S�T)r6�r�r�s  rr�z$_transform_attrs.<locals>.<listcomp>*s&��?�?�?��Q�X�X�d�X�+�+�?�?�?rc�:�g|]}|�d�����Sr�r�r�s  rr�z$_transform_attrs.<locals>.<listcomp>+s&��A�A�A��a�h�h�t�h�,�,�A�A�ArFc3�>K�|]}|jdu�|jdu�|V��dS)FN)r3r6r�s  rr�z#_transform_attrs.<locals>.<genexpr>4s:����
M�
M�A�!�&��"5�"5�!�)�u�:L�:L�a�:L�:L�:L�:L�
M�
MrzlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: c�p�g|]3}|js(|�t|j�����n|��4S))r<)r<r��_default_init_alias_forr^r�s  rr�z$_transform_attrs.<locals>.<listcomp>DsO��
�
�
�
�@A�w�M����.�q�v�6�6��7�7�7�A�
�
�
rc��g|]	}|j��
Srr�r�s  rr�z$_transform_attrs.<locals>.<listcomp>Ks��(�(�(�Q�!�&�(�(�(r)�__dict__r��itemsr�r�r�r�rrBrGrIrlrYrrn�sortedr�r�r.r?rurrv)r��these�auto_attribsr6�collect_by_mro�field_transformer�ca_list�ca_names�annot_namesrtr+r��unannotated�	own_attrsrxr�rw�had_defaultrp�
AttrsClassr�r�s                    @@r�_transform_attrsr��s�����

��B��C� � �D���<�<�e�k�k�m�m�<�<�<���	��	�	�
�
� �h�h�j�j�
�
�
��
���e�e��#�z�z�|�|�	+�	+�O�I�t��T�"�"�
���O�O�I�&�&�&����y�'�*�*�A��a��/�/�
*���<�<����A�A��q�)�)�)�A��N�N�I�q�>�*�*�*�*���,���{���a���+�C��)�)��;�,G�,G�,G�,G�H�H�H�����	���
� ��
�
�"$�(�(�*�*�
�
�
�
'�&�

�
�
������%�	���I��
�$7��,�,�)�,�,�,�%
�%
�!�
�M�M�%?��,�,�)�,�,�,�%
�%
�!�
�M��B�?�?�Y�?�?�?�	�A�A�j�A�A�A�
���"�E��K�
M�
M��
M�
M�
M�����$���1�9��#7�#7��K�EF�K�K���
�
�%���A�I�W�$<�$<��K���$�!�!�#�u�-�-��

�
��
�
�
�E�)�(�%�(�(�(�J�'���j�A�A�J��
�
�5�)�)�:�}�E�F�F�Frc��t|t��r"|dvrt�|||��dSt���)z4
    Attached to frozen classes as __setattr__.
    )�	__cause__�__context__�
__traceback__N)rB�
BaseException�__setattr__r
�rr^�values   r�_frozen_setattrsr�QsR���$�
�&�&��4�4�,�,�
	�!�!�$��e�4�4�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�ZdS)�
_ClassBuilderz(
    Iteratively build *one* class.
    )�_attr_names�_attrs�_base_attr_map�_base_names�_cache_hash�_cls�	_cls_dict�_delete_attribs�_frozen�
_has_pre_init�_has_post_init�_is_exc�_on_setattr�_slots�
_weakref_slot�_wrote_own_setattr�_has_custom_setattrc���t||||||��\}}}||_|rt|j��ni|_||_d�|D��|_||_td�|D����|_	||_
||_||_|	|_
tt|dd����|_tt|dd����|_t|��|_|
|_||_|
|_d|_|j|jd<|r&t.|jd<t0|jd<d	|_n{|t2t4jt4jfvr[dx}}|D]}|j�d	}|j�d	}|r|rn�|t2kr|s|r$|t4jkr|r|t4jkr	|sd|_|r)|���\|jd
<|jd<dSdS)Nc��h|]	}|j��
Srr�r�s  rr�z)_ClassBuilder.__init__.<locals>.<setcomp>�s��7�7�7�q�A�F�7�7�7rc3�$K�|]}|jV��dSr'r�r�s  rr�z)_ClassBuilder.__init__.<locals>.<genexpr>�s$���� 7� 7�A��� 7� 7� 7� 7� 7� 7r�__attrs_pre_init__F�__attrs_post_init__r�r��__delattr__T�__getstate__�__setstate__) r�r��dictr�r�r�r�r�rDr�r�r�r�r��boolr�r�r�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_map�
has_validator�
has_converterr�s                     r�__init__z_ClassBuilder.__init__�sP��"'7�������
'
�'
�#��z�8���	�/4�<��c�l�+�+�+�"������7�7�J�7�7�7���&��� � 7� 7�� 7� 7� 7�7�7���������)���%���!�'�#�/C�U�"K�"K�L�L���"�7�3�0E�u�#M�#M�N�N���#'��;�;�������%���#5�� �"'���,0�K���(�)��	(�,<�D�N�=�)�,<�D�N�=�)�&*�D�#�#�
�"����O�
�
�
�
-2�1�M�M��
�
���;�*�$(�M��;�*�$(�M� ��]���E���"8�8�8�*�9�.;�9��'�"2�2�2�=�2��'�/�1�1�-�1�
$(�� ��	/��,�,�.�.�
���~�.���~�.�.�.�	/�	/rc�"�d|jj�d�S)Nz<_ClassBuilder(cls=z)>)r�rrs rrz_ClassBuilder.__repr__�s��;�T�Y�%7�;�;�;�;rrNc��|jdur|���S|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�sL���{�d�"�"��/�/�1�1�1��8�2�2��*�*�,�,���
rc�d�|jdur|���S|���Sr)r�rrrs rrz_ClassBuilder.build_class�s5���{�d�"�"��/�/�1�1�1��-�-�/�/�/rc��|j}|j}|jrM|jD]E}||vr?t	||t
��t
ur"	t
||���5#t$rY�AwxYw�F|j�	��D]\}}t|||���|js+t	|dd��rd|_|j
st|_|S)zA
        Apply accumulated methods and return the class.
        �__attrs_own_setattr__F)r�r�r�r�r�r��delattr�AttributeErrorr�r��setattrr�rr��_obj_setattrr�)rr��
base_namesr^r�s     rrz#_ClassBuilder._patch_original_class�s���i���%�
���	��(�
�
���
�*�*���T�9�5�5�Y�F�F����T�*�*�*�*��)������	����� �>�/�/�1�1�	&�	&�K�D�%��C��u�%�%�%�%��&�	/�7��(�%�,
�,
�	/�).�C�%��+�
/�".����
s�A�
A�Ac	�t��
���
��fd��j���D��}�jsBd|d<�js6�jjD])�
�
j�dd��rt|d<n�*t��}d}�jj
dd�D]O�
�
j�dd���d	}|��
fd
�t�
dg��D�����Pt�j����j}�jr#dt�jdd��vrd|vr|s|d
z
}�fd�|D���
�
fd�|���D����fd��
D���
|�����jr�
�t&��t)�
��|d<�jj|d<t-�j���jj�jj|��}|j���D]�}t3|t4t6f��rt|jdd��}n=t3|t:��rt|jdd��}nt|dd��}|s�u|D]3}	|j�ju}	|	rtA||���$#tB$rY�0wxYw��|S)zL
        Build and return a new class with a `__slots__` attribute.
        c�N��i|]!\}}|t�j��dzv�||��"S))r��__weakref__)rDr�)r��k�vrs   �r�
<dictcomp>z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>sE���
�
�
���1���d�.�/�/�2M�M�M�M�
�q�M�M�MrFrr�rrVr#NTc�2��i|]}|t�|����Sr�r�)r�r^r�s  �rr&z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>>s5��������'�(�D�1�1���r�	__slots__r)r#c���g|]}|�v�|��	Srr)r�r^r s  �rr�z5_ClassBuilder._create_slots_class.<locals>.<listcomp>Qs#���G�G�G�t��J�0F�0F�d�0F�0F�0Frc�$��i|]\}}|�v�	||��
Srr)r��slot�slot_descriptor�
slot_namess   �rr&z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>Vs4���
�
�
�%��o��z�!�!�
�/�!�!�!rc���g|]}|�v�|��	Srr)r�r^�reused_slotss  �rr�z5_ClassBuilder._create_slots_class.<locals>.<listcomp>[s#���N�N�N�t�T��5M�5M�d�5M�5M�5Mrr �__closure__)"r�r�r�r�r��	__bases__r�r�rrr��updater�r�r�r�r�r�rl�_hash_cache_fieldrDr r+r�valuesrB�classmethod�staticmethod�__func__rm�fget�
cell_contentsrr?)rr��existing_slots�weakref_inherited�namesr��item�
closure_cells�cell�matchr�r r0r.s`         @@@@rrz!_ClassBuilder._create_slots_classs��������
�
�
�
���,�,�.�.�
�
�
���&�	�*/�B�&�'��+�
� $�	� 3���H��(�,�,�-D�e�L�L��,8��=�)��������!���	�)�!�B�$�/�	�	�H�� �$�$�]�D�9�9�E�$(�!��!�!����� '��+�r� B� B����
�
�
�
���)�*�*�
�� ����	&��W�T�Y��R�%H�%H�H�H��U�*�*�%�+�
�%�%�E�H�G�G�G�u�G�G�G�
�

�
�
�
�)7�)=�)=�)?�)?�
�
�
��
O�N�N�N�z�N�N�N�
�
�	�	�,������	1����/�0�0�0��
�+�+��;��!�Y�3��>���d�4�9�o�o�d�i�0�$�)�2E�r�J�J���L�'�'�)�)�	4�	4�D��$��l� ;�<�<�	
C�!(��
�}�d� K� K�
�
��D�(�+�+�
C�!(��	�=�$� G� G�
�
� '��m�T� B� B�
� �
��%�
4�
4��4� �.�$�)�;�E��4�(��s�3�3�3���	"�����D�����
4��
s�J'�'
J4�3J4c�r�|�t|j||j����|jd<|S)Nr)�_add_method_dunders�
_make_reprr�r�r�)r�nss  r�add_reprz_ClassBuilder.add_repr�s8��%)�%=�%=��t�{�B��	�2�2�&
�&
���z�"��rc��|j�d��}|�td���d�}|�|��|jd<|S)Nrz3__str__ can only be generated if a __repr__ exists.c�*�|���Sr'�rrs r�__str__z&_ClassBuilder.add_str.<locals>.__str__�s���=�=�?�?�"rrJ)r�r�r?rC)rr0rJs   r�add_strz_ClassBuilder.add_str�sa���~�!�!�*�-�-���<��E���
�	#�	#�	#�%)�$<�$<�W�$E�$E���y�!��rc�n���td�|jD������fd�}|j���fd�}||fS)zF
        Create custom __setstate__ and __getstate__ methods.
        c3�&K�|]}|dk�|V��
dS)r#Nr)r��ans  rr�z8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>�s5����!
�!
��R�=�-@�-@�B�-@�-@�-@�-@�!
�!
rc�"����fd��D��S)�9
            Automatically created by attrs.
            c�2��i|]}|t�|����Srr(�r�r^rs  �rr&zQ_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate.<locals>.<dictcomp>�s%���K�K�K�$�D�'�$��-�-�K�K�Krr)r�state_attr_namess`�r�slots_getstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate�s"����L�K�K�K�:J�K�K�K�Krc���t�|��}t|t��r#t	�|��D]\}}|||���n�D]}||vr||||����r|t
d��dSdS)rPN)r�__get__rBrD�zipr4)r�state�_ClassBuilder__bound_setattrr^r��hash_caching_enabledrSs     ��r�slots_setstatez=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstate�s����+�2�2�4�8�8�O��%��'�'�
;�$'�'7��#?�#?�1�1�K�D�%�#�O�D�%�0�0�0�0�1�-�;�;�D��u�}�}�'���e�D�k�:�:�:��$�
9��� 1�4�8�8�8�8�8�
9�
9r)rDr�r�)rrTr[rZrSs   @@rrz%_ClassBuilder._make_getstate_setstate�s�����
!�!
�!
��)�!
�!
�!
�
�
��	L�	L�	L�	L�	L� $�/��	9�	9�	9�	9�	9�	9�,�~�-�-rc��d|jd<|S)N�__hash__)r�rs r�make_unhashablez_ClassBuilder.make_unhashable�s��%)���z�"��rc��|�t|j|j|j|j�����|jd<|S)N�rr
r])rC�
_make_hashr�r�r�r�r�rs r�add_hashz_ClassBuilder.add_hash�sL��%)�%=�%=���	����|��+�	
�
�
�&
�&
���z�"��rc���|�t|j|j|j|j|j|j|j|j	|j
|jd�����|jd<|S)NF��
attrs_initr�
rC�
_make_initr�r�r�r�r�r�r�r�r�r�r�rs r�add_initz_ClassBuilder.add_init�sq��%)�%=�%=���	����"��#������ ��#���� � �
�
�
�&
�&
���z�"� �rc�R�td�|jD����|jd<dS)Nc3�@K�|]}|j�	|j�|jV��dSr')r3r6r^)r��fields  rr�z/_ClassBuilder.add_match_args.<locals>.<genexpr>�sL����1
�1
���z�1
�#(�-�1
��J�1
�1
�1
�1
�1
�1
r�__match_args__)rDr�r�rs r�add_match_argsz_ClassBuilder.add_match_args�s=��+0�1
�1
���1
�1
�1
�,
�,
���'�(�(�(rc���|�t|j|j|j|j|j|j|j|j	|j
|jd�����|jd<|S)NTrd�__attrs_init__rfrs r�add_attrs_initz_ClassBuilder.add_attrs_init�sr��+/�+C�+C���	����"��#������ ��#���� ��
�
�
�,
�,
���'�(� �rc��|j}|�t|j|j����|d<|�t����|d<|S)N�__eq__�__ne__)r�rC�_make_eqr�r��_make_ne�rr�s  r�add_eqz_ClassBuilder.add_eq�sU��
�^���/�/��T�Y���,�,�
�
��8���/�/��
�
�;�;��8���rc����j}�fd�t�j�j��D��\|d<|d<|d<|d<�S)Nc3�B�K�|]}��|��V��dSr')rC)r��methrs  �rr�z*_ClassBuilder.add_order.<locals>.<genexpr>sM�����B
�B
��
�$�$�T�*�*�B
�B
�B
�B
�B
�B
r�__lt__�__le__�__gt__�__ge__)r��_make_orderr�r�rvs` r�	add_orderz_ClassBuilder.add_ordersg���
�^��B
�B
�B
�B
�#�D�I�t�{�;�;�B
�B
�B
�>��8��b��l�B�x�L�"�X�,�
�rc� ��|jr|Si�|jD],}|jp|j}|r|tjur||f�|j<�-�s|S|jrtd����fd�}d|j	d<|�
|��|j	d<d|_|S)Nz7Can't combine custom __setattr__ with on_setattr hooks.c���	�|\}}||||��}n#t$r|}YnwxYwt|||��dSr')�KeyErrorr)rr^�valr��hook�nval�sa_attrss      �rr�z._ClassBuilder.add_setattr.<locals>.__setattr__&sl���
*�"�4�.���4��t�D�!�S�)�)�����
�
�
�����
����

��t�T�*�*�*�*�*s��+�+Trr�)r�r�r;r�r�NO_OPr^r�r?r�rCr�)rr�r;r�r�s    @r�add_setattrz_ClassBuilder.add_setattrs�����<�	��K�����	1�	1�A���9��)9�J��
1�j��
�=�=�#$�j�=���� ���	��K��#�	��I���
�
	+�	+�	+�	+�	+�37���.�/�(,�(@�(@��(M�(M���}�%�"&����rc��	|jj|_n#t$rYnwxYw	d�|jj|jf��|_n#t$rYnwxYw	d|jj�d�|_n#t$rYnwxYw|S)zL
        Add __module__ and __qualname__ to a *method* if possible.
        r�z$Method generated by attrs for class )r�rrrnr rr!)r�methods  rrCz!_ClassBuilder._add_method_dunders6s���	� $�	� 4�F�����	�	�	��D�	����	�"%�(�(���'���9�#�#�F�����	�	�	��D�	����	�-��9�)�-�-�-�
�N�N���	�	�	��D�	�����
s/��
!�!�+A�
A�A�"A8�8
B�B)rrr r!r)rrrrrrrrFrKrr^rbrhrmrprwr�r�rCrrrr�r�gsV���������I�(S/�S/�S/�j<�<�<�
�0��
�
�
�	�	�	�	�		0�		0�		0�$�$�$�Lh�h�h�T������'.�'.�'.�R���
�
�
����&
�
�
����&������"�"�"�H����rr�c��|�$t|du|duf��rtd���|�||fS|�|}|�|}|dur|durtd���||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_eqs    r�_determine_attrs_eq_orderr�Qs���
��3��$���T�0A�B�C�C���A�B�B�B����C�x��
�z�
���}���	�U�{�{�u��}�}��H�I�I�I�
�u�9�rc��|�$t|du|duf��rtd���d�}|�||��\}}||||fS|�|d}}n||��\}}|�||}}n||��\}}|dur|durtd���||||fS)r�Nr�c�6�t|��rd|}}nd}||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_booleanss,���E�?�?�	��u�3�E�E��C��c�z�rFTr�r�)r1r7r9r�r��cmp_keyr8r:s        rr=r=ks���
��3��$���T�0A�B�C�C���A�B�B�B������1�1�#�6�6���W��G�S�'�)�)�
�z���F���/�/��3�3�
��F��}��v�y���5�5�e�<�<���y�	�U�{�{�u��}�}��H�I�I�I�
�v�u�i�'�'rc�Z�|dus|dur|S|�|dur|S|D]}t||��rdS�|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��sd���t�|�|�t�u�}�}����|��u�,�,��������c�6�*�*�	��5�5�	��Nrc���������	�
���
����������t|||d��\��|�|�t�ttf��rt	j�������
���������������
��	fd�}|�|S||��S)a4
    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 Optional[bool] 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*!
    :param Optional[bool] 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*.
    :param Optional[bool] cmp: Setting *cmp* is equivalent to setting *eq*
        and *order* to the same value. Must not be mixed with *eq* or *order*.
    :param Optional[bool] 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.

        See 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 Optional[bool] 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__()``.
    :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.

       See issue `#428 <https://github.com/python-attrs/attrs/issues/428>`_ for
       more details.

    :param Optional[bool] 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 Optional[callable] 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.  See `transform-fields` for more details.

    :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����
pt|��}�duot|t��}�ot|d��}|r|rt	d���t|��|�t
|��d�������	|�
�|���}t
|��d��r|�����dur|���t
|��d��}|s|dur|�	��|s&t
|��d��r|�
��|������durt|d	��rd
��dur�d
ur��td����d
us��|d
us|r�	rtd���nH�dus
��|dur|dur|�
��n%�	rtd���|���t
|��d
��r|���n%|����	rtd���t"r&�r$t|d��s|���|���S)NTr�z/Can't freeze a class with a custom __setattr__.)r�r�r�rI)rrrs)r{r|r}r~r]Fr-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.rl)�_has_frozen_base_class�
issubclassr�r�r?r�r�rFrKrwr�r�r>rbr^rhrprrmr)r��	is_frozenr�has_own_setattr�builderr7r�r��auto_excr
r��eq_r�rr	r2r3r6�
match_argsr;�order_r0�repr_nsrr}r�rs      ���������������������r�wrapzattrs.<locals>.wrap�sP����9�4�S�9�9�	��T�!�D�j��m�&D�&D��%�
�*<���+
�+
���	P�y�	P��N�O�O�O�������+��!��0��
�
�
�
��������)
�
��,+���{�M�
�
�	&�
���W�%�%�%��$�;�;��O�O����
,���k�#7�
�
���	�"��*�*��N�N�����	 �9����&N�
�
�	 �
������������
�L��t�#�#�"�3�
�3�3�$��D��t����E� 1� 1�d�6F��H���
��U�]�]�t�|��e������
������
��T�\�\��L�R�4�Z�Z�I��,=�,=�
��������
������

�#�#�%�%�%�*���{�M�
�
�
	�
��������"�"�$�$�$��
��*����
�	%��	%�'�s�,<�=�=�	%�

�"�"�$�$�$��"�"�$�$�$r)r�rBrCrDrrE)�	maybe_clsr�r�r0r1r2r3rrrr}r�r6r
r�r7r9r�r�r	r;r�r��unsafe_hashr�r�r�s ``` ``````````  ``````  @@rrwrw�s�����������������������t,�C��U�D�A�A�K�C�������*�t�U�m�,�,�/��\�:�.�
�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�k%�^�����t�I���rc��|jtuS)zV
    Check whether *cls* has a frozen ancestor by looking at its
    __setattr__.
    )r�r�r�s rr�r�Ms��
�?�.�.�.rc
�L�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  r�_generate_unique_filenamer�UsF��
	9�I�	9�	9���	9�	9��3����5�5�	9�	9�	9�rc�n��	�
���
�td��D�����d}t|d��}t|���
i�
d}d�d�	|s|dz
}n|dz
}|d	z
}d
�z��	dz
�	|g���	�
���
fd�}|r���|d
t�d�z��|r4|dt�d�|dz����|dzdz��n|dt�d�|dz����|dt��z��n|d|��d����}t
d||�
��S)Nc3�LK�|]}|jdus|j�|jdu�|V�� dS)TN)r2r7r�s  rr�z_make_hash.<locals>.<genexpr>`sA�������A�F�d�N�N�q�v�~�!�$�$�,�,��,�,�,�,��r�        r2zdef __hash__(selfzhash((rgz):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper(�)c	�T����||z�z|d�	�d�zg���D]d}|jr:d|j�d�}|j�|<��|d|�d|j�d�z���C��|d|j�d�z���e��|dz�z��d	S)
z�
        Generate the code for actually computing the hash code.
        Below this will either be returned directly or used to compute
        a value which is then cached, depending on the value of cache_hash
        r��,�_�_key�(self.�),�
        self.rfN)�extendr8r^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���	������)�+��0�I�0�0�0�0�
�	
�	
�	
��	H�	H�A��x�
H�+�q�v�+�+�+��"#�(��h���#�#��B��B�B���B�B�B�B������#�#�F�-F�Q�V�-F�-F�-F�$F�G�G�G�G����F�V�O�n�<�=�=�=�=�=rzif self.z	 is None:zobject.__setattr__(self, '�', ��self.� = zreturn self.zreturn rjr])rDr�r2rlr4rnrc)r�rwrr
�tab�unique_filename�hash_defr�rOr�rPr�r�r�s `       @@@@@rrara_s����������������
�
�E��C�/��V�<�<�O��_�%�%�I��E�"�H��I��N��
��D�����E����
C�	
��&�	�1�	��#����:�L�>�>�>�>�>�>�>�>�>�>�4�
6����C�"I�->�"I�"I�"I�I�J�J�J��	�)�)�C�->�C�C�C�S�1�W�
�
�
�
����a��#�
�.�.�.�.�)�)�.�)�.�.�.��a��
�
�
�	���C�"D�1B�"D�"D�D�E�E�E�E�%�%�i��5�5�5�
�Y�Y�|�
$�
$�F��
�F�O�U�C�C�Crc�6�t||dd���|_|S)z%
    Add a hash method to *cls*.
    Fr`)rar]�r�rws  r�	_add_hashr��s!���c�5��5�I�I�I�C�L��Jrc��d�}|S)z
    Create __ne__ method.
    c�R�|�|��}|turtS|S)zj
        Check equality and either forward a NotImplemented or
        return the result negated.
        )rr�NotImplemented)r�other�results   rrsz_make_ne.<locals>.__ne__�s.��
���U�#�#���^�#�#�!�!��z�rr)rss rruru�s��
	�	�	��Mrc�F�d�|D��}t|d��}gd�}i}|r�|�d��dg}|D]�}|jrXd|j�d�}|j||<|�d|�d	|j�d
���|�d|�d|j�d
����a|�d|j�d
���|�d|j�d
�����||dgzz
}n|�d��d�|��}td|||��S)z6
    Create __eq__ method for *cls* with *attrs*.
    c� �g|]}|j�	|��Sr)r7r�s  rr�z_make_eq.<locals>.<listcomp>�s��&�&�&�1���&�Q�&�&�&rr7)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 Truerjrr)r�rlr8r^rnrc)	r�rwr��linesrP�othersr�r�rOs	         rrtrt�sx��
'�&��&�&�&�E�/��T�:�:�O�
�
�
�E�
�E��(�
���_�%�%�%�����
	:�
	:�A��x�	
:�+�q�v�+�+�+��#$�(��h�����B��B�B���B�B�B�C�C�C��
�
�D��D�D�!�&�D�D�D�E�E�E�E����6�Q�V�6�6�6�7�7�7��
�
�8�q�v�8�8�8�9�9�9�9�
��7�)�#�#���
���&�'�'�'�
�Y�Y�u�
�
�F���&�/�5�A�A�Arc�\���d��D����fd���fd�}�fd�}�fd�}�fd�}||||fS)z9
    Create ordering methods for *cls* with *attrs*.
    c� �g|]}|j�	|��Sr)r9r�s  rr�z_make_order.<locals>.<listcomp>�s��)�)�)�1���)�Q�)�)�)rc�P���td��fd��D��D����S)z&
        Save us some typing.
        c3�:K�|]\}}|r||��n|V��dSr'r)r�r�r�s   rr�z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>�sK����
�
���s��(�C�C��J�J�J�5�
�
�
�
�
�
rc3�P�K�|] }t�|j��|jfV��!dSr')r�r^r:)r�r��objs  �rr�z6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>�sG�������89���a�f�%�%�q�{�3������r)rD)r�rws`�r�attrs_to_tuplez#_make_order.<locals>.attrs_to_tuple�sW�����
�
�����=B����
�
�
�
�
�	
rc�^��|j|jur�|���|��kStS�z1
        Automatically created by attrs.
        ��	__class__r��rr�r�s  �rr{z_make_order.<locals>.__lt__��9����?�d�n�,�,�!�>�$�'�'�.�.��*?�*?�?�?��rc�^��|j|jur�|���|��kStSr�r�r�s  �rr|z_make_order.<locals>.__le__�9����?�d�n�,�,�!�>�$�'�'�>�>�%�+@�+@�@�@��rc�^��|j|jur�|���|��kStSr�r�r�s  �rr}z_make_order.<locals>.__gt__r�rc�^��|j|jur�|���|��kStSr�r�r�s  �rr~z_make_order.<locals>.__ge__r�rr)r�rwr{r|r}r~r�s `    @rrr�s�����
*�)��)�)�)�E�	
�	
�	
�	
�	
����������������������6�6�6�)�)rc�h�|�|j}t||��|_t��|_|S)z5
    Add equality methods to *cls* with *attrs*.
    )r�rtrrrursr�s  r�_add_eqr�$s2��
�}��#���#�u�%�%�C�J����C�J��Jrc��t|d��}td�|D����}d�|D��}t|d<t|d<t|d<g}|D]H\}}}	|	rd|znd|zd	z}
|t
kr|�d
|
�d�n
|�d
|�d|
�d
�}|�|���Id�|��}|�d}
n|dz}
ddddddddddddd|
�d|�d�dd g}td!d"�|��||�#��S)$Nr0c3�pK�|]1}|jdu�|j|jdurtn|j|jfV��2dS)FTN)r0r^r3r�s  rr�z_make_repr.<locals>.<genexpr>6sV����"�"�
��6����
��!�&�D�.�.�$�$�a�f�q�v�>�����"�"rc�8�i|]\}}}|tk�|dz|��S)�_repr)r0)r�r^�rr�s    rr&z_make_repr.<locals>.<dictcomp>;s0��
�
�
�(�d�A�q�Q�$�Y�Y��w���Y�Y�Yrrrrr�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�rDrrrr0rlrnrc)rwrEr�r��attr_names_with_reprsrP�attribute_fragmentsr^r�rs�accessor�fragment�
repr_fragment�cls_name_fragmentr�s               rrDrD1s���/��V�<�<�O�"�"�"��"�"�"����

�
�,A�
�
�
�E��E�)��,�E�
���E�)����+�	-�	-�
��a���M�G�d�N�N�%6��%=�
�%M�	�
�D�y�y� �4�4����*�*�'+�t�t�T�T�T�8�8�8�<�	�
	�"�"�8�,�,�,�,��I�I�1�2�2�M�	�z�O����!=�=��	��D�"�+�D��-���-��=�)�=�=�M�=�=�=��.�
�E�$��D�I�I�e�$�$�o�U����rc�D�|�|j}t|||��|_|S)z%
    Add a repr method to *cls*.
    )r�rDr)r�rErws   r�	_add_reprr�js)��
�}��#���e�R��-�-�C�L��Jrc��t|��}|�$t|t��std���t	|dd��}|�0|�t	|dd��}|�	||_|St
|�d����|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.)r
rBr+r>r�r�r)r��generic_baserws   r�fieldsr�us���&$�C�(�(�L���J�s�D�$9�$9���8�9�9�9��C�*�D�1�1�E��}��#��L�*;�T�B�B�E�� �',��#���"�c�#N�#N�#N�O�O�O��Lrc��t|t��std���t|dd��}|�t	|�d����d�|D��S)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�c��i|]
}|j|��Srr�r�s  rr&zfields_dict.<locals>.<dictcomp>�s��%�%�%�!�A�F�A�%�%�%r)rBr+r>r�rr�s  r�fields_dictr�sg���c�4� � �:��8�9�9�9��C�*�D�1�1�E��}�"�c�#N�#N�#N�O�O�O�%�%�u�%�%�%�%rc	��tjdurdSt|j��D]+}|j}|� |||t||j�����,dS)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�sg����%�'�'���
�D�N�
#�
#�.�.��
�K���=�
�A�d�A�w�t�Q�V�,�,�-�-�-��.�.rc��d|jvS)Nr))r�r�s r�_is_slot_clsr�s���#�,�&�&rc�4�||vot||��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�'J�Jrc
��|	duo
|	tju}|r|rtd���|p|}g}
i}|D]k}|js|jt
ur�|
�|��|||j<|j�|durtd���d}�T|r|jtjurd}�lt|d��}t|
||||||||||
��\}}}|jtj
vr/|�tj
|jj��|�t
|d���|rt j|d<t%|
rdnd|||��}||_|S)Nz$Frozen classes can't use on_setattr.Tr3)r�	attr_dict�_cached_setattr_getror)rr�r?r3r.rrlr^r;r��_attrs_to_init_scriptr�sys�modulesr3r�rrVrcr�)r�rw�pre_init�	post_initrrr
r�r�cls_on_setattrre�has_cls_on_setattr�needs_cached_setattr�filtered_attrsrr�r�rOrP�annotationsr3s                     rrgrg�s���	�d�"�J�~�W�]�'J���A�$�A��?�@�@�@�%�/����N��I�
�
(�
(���v�	�!�)�w�.�.�����a� � � ��	�!�&���<�#���~�~� �!G�H�H�H�#'� � �
�	(�A�L��
�$E�$E�#'� ��/��V�<�<�O�!6���
���������"�"��F�E�;��~���$�$�
���S�[���0�9�:�:�:�	�L�L�W�9�=�=�>�>�>��<�(4�';��#�$��&�6���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�_setattrrs��3�	�2�2�i�2�2�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�8�|rt||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!.s4��
�0��	�5�$�/�/�/�(�9�(�(��(�(�(rc�R�|rt||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#9sO��
�C�&�y�)�T�B�B�B�C�	�	�	��y�l�*�*�*��	�	��rc
���g}|r|�d��|r|�d��|dur3|durt}t}
n.|�d���fd�}�fd�}
nt}t}
g}g}g}i}ddi}|D�]s}|jr|�|��|j}|jdup|jtj	uo|	}|j
}t|jt��}|r|jjrd	}nd
}|jdu�r|r�t |jfz}|j�B|�|
||d|�d
�z|����t$|jfz}|j||<n'|�|||d|�d
�z|����|jj||<�n|j�@|�|
|d|�d�|����t$|jfz}|j||<�n�|�||d|�d�|�����n�|jt(ur�|s�|�d|�d�}|jr|�|��n|�|��|j�:|�|
|||����|j|t$|jfz<�n|�||||�����n�|�rX|�d�}|jr|�|��n|�|��|�d|�d���t |jfz}|j�}|�d|
|||��z��|�d��|�d|
||dz|zd
z|��z��|j|t$|jfz<nd|�d||||��z��|�d��|�d|||dz|zd
z|��z��|jj||<n�|jr|�|��n|�|��|j�9|�|
|||����|j|t$|jfz<n |�||||����|jdurN|j�|j�|j||<��?|j�-t/|j�����}|r|||<��u|rkt2|d<|�d��|D]I}d|jz}d|jz}|�d|�d|�d|j�d
���|j||<|||<�J|r|�d��|r+|r|rd}nd}nd}|�|t4d fz��|r8d!�d"�|D����}|�d#|�d
���d$�|��}|r!||rd$nd
�d%d$�|����z
}d&|
rd'nd(�d|�d)|rd*�|��nd+�d,�||fS)-z�
    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�V��t|���rt|||��Sd|�d|��S)N�_inst_dict['�'] = )r	r�rtrrr�s   �r�
fmt_setterz)_attrs_to_init_script.<locals>.fmt_setterts>��� ��M�:�:�J�#�I�y�.�I�I�I�A�i�A�A�i�A�A�Arc�t��|st|���rt|||��Sd|�dt|fz�d|�d�S)Nr&r'r�r�)r	rrr(s   �r�fmt_setter_with_converterz8_attrs_to_init_script.<locals>.fmt_setter_with_converterzsf���"��]�9�m�%L�%L��2�!�9�n������I�I�'�9�,�6�6�6��I�I��r�returnNrrJFr�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�8K�|]}|j�	d|j��V��dS)r�N)r3r^r�s  rr�z(_attrs_to_init_script.<locals>.<genexpr>J	s4����B�B�Q�1�6�B�(���(�(�B�B�B�B�B�BrzBaseException.__init__(self, r�z*, zdef rorz):
    z
    �passrj)rlrrr!r#r/r^r;rr�r<rBr.rA�
takes_selfr3�_init_factory_patr4rrHrr6r+r	�get_first_param_typerr4rn) rwrrrrr
r�rrrrer�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�valss       `                         rr
r
Hs����*
�E��2�
���0�1�1�1��
�
���
3�		
�	
�	
���~�~��D�=�=�!�J�(?�%�%�
�L�L�5�6�6�6�
B�
B�
B�
B�
B�
�
�
�
�
�
� �
�$:�!�
�D��L������T�"�K�
�Q.�Q.���;�	(��$�$�Q�'�'�'��F�	���T�1�
�
�L��
�-�D�2D�	�
�7�� ���G�4�4���	�1�9�/�	��J�J��J��6�U�?�?��'
�$5���	�$A�!��;�*��L�L�1�1�%�-�0A�J�0A�0A�0A�A�*������!4�q�v�i� ?�I�34�;�%�i�0�0��L�L�"�
�%�-�0A�J�0A�0A�0A�A�*������89�y�7H�!�"3�4�4��;�*��L�L�1�1�%�?�)�?�?�?�*������!4�q�v�i� ?�I�34�;�%�i�0�0��L�L�"�
�%�?�)�?�?�?�*��������Y�g�
%�
%�k�
%��@�@�9�@�@�@�C��y�
!��#�#�C�(�(�(�(����C� � � ��{�&����-�-�!�8�^�������K�"�'�1�6�)�3������Z�Z�	�8�^�L�L�M�M�M�M�
�:	N��'�'�'�C��y�
!��#�#�C�(�(�(�(����C� � � ��L�L�9�x�9�9�9�:�:�:� 1�Q�V�I� =���{�&�����/�/�!�8�^����������W�%�%�%�����/�/�!�)�C�/�*�<�s�B�&��������K�"�'�1�6�)�3�������Z�Z�	�8�^�L�L�L�������W�%�%�%����� �j�!�)�C�/�*�<�s�B�&�������45�9�3D��/�0�0��y�
&��#�#�H�-�-�-�-����H�%�%�%��{�&����-�-�!�8�^�������K�"�'�1�6�)�3������Z�Z�	�8�^�L�L�M�M�M��6�T�>�>��v�!�a�k�&9�()���H�%�%���(�(���5�5�J�J�L�L���.�,-�K��)���-�'.��)�$�
���:�;�;�;�"�	-�	-�A�*�Q�V�3�H�!�A�F�*�I��L�L�L��L�L��L�L�1�6�L�L�L�M�M�M�*+�+��h�'�+,��i�(�(��3�
���1�2�2�2��
D��	-��
:�"6���#:���,�O�
���_�(9�6�'B�B�C�C�C��>��x�x�B�B�%�B�B�B�B�B��
���<�T�<�<�<�=�=�=��9�9�T�?�?�D��
��� �D�D�b� � ��I�I�l�#�#�#�
�	
���",�
;�
�
��
;�
;��D�D�$)�5�H�M�M�%� � � �v�5�5�		
�	��	�	rr^r,c�,�|�d��S)z�
    The default __init__ parameter name for a field.

    This performs private-name adjustment via leading-unscore stripping,
    and is the default value of Attribute.alias if not provided.
    r�)�lstripr�s rr�r�a	s���;�;�s���rc�h�eZdZdZdZ										dd�Zd�Zed
d���Zd�Z	d	�Z
d
�Zd�ZdS)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<NFc�X�t||p|
|p|d��\}
}}}t�|��}|d|��|d|��|d|��|d|��|d|
��|d|��|d|��|d	|��|d
|��|d|��|d|��|d
|	r!tjt|	����nt��|d|
��|d|��|d|��|d|��|d|��dS)NTr^r.r/r0r7r8r9r:r2r3r4r5r+r6r�r;r<)r=rrV�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�2�
�	�
�f�d�#�#�#��
�i��)�)�)��
�k�9�-�-�-��
�f�d�#�#�#��
�d�B�����
�h��'�'�'��
�g�u�%�%�%��
�k�9�-�-�-��
�f�d�#�#�#��
�f�d�#�#�#��
�k�9�-�-�-��
���/��&�t�H�~�~�6�6�6�.�	
�	
�	
�	�
�f�d�#�#�#��
�i��)�)�)��
�k�9�-�-�-��
�l�J�/�/�/��
�g�u�%�%�%�%�%rc��t���r'r�r�s   rr�zAttribute.__setattr__�	s��!�#�#�#rc
���|��j}n�j�td����fd�tjD��}|d|�j�j|ddd�|��S)Nz8Type annotation and type argument cannot both be presentc�:��i|]}|dv�|t�|����S))r^r/r.r+r�r()r�r$r�s  �rr&z0Attribute.from_counting_attr.<locals>.<dictcomp>�	sE���
�
�
������
�w�r�1�~�~���rF)r^r/r.r+r1r�r)r+r?r�r)�
_validator�_default)r�r^r�r+�	inst_dicts  `  rr�zAttribute.from_counting_attr�	s�����<��7�D�D�
�W�
 ��J���
�
�
�
�
��(�
�
�
�	��s�
���m��K����

�
��
�
�	
rc�|�tj|��}|�|�����|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
s0���i��o�o���
�
�g�m�m�o�o�&�&�&��
rc�D��t�fd��jD����S)�(
        Play nice with pickle.
        c3�l�K�|].}|dkrt�|��nt�j��V��/dS)r5N)r�rr5rRs  �rr�z)Attribute.__getstate__.<locals>.<genexpr>
sZ�����
�
��$(�:�#5�#5�G�D�$����4��
�;N�;N�
�
�
�
�
�
r�rDr)rs`rr�zAttribute.__getstate__
s?����
�
�
�
���
�
�
�
�
�	
rc�V�|�t|j|����dS�rWN)rSrWr))rrXs  rr�zAttribute.__setstate__!
s(��	
���s�4�>�5�1�1�2�2�2�2�2rc	���t�|��}|D]L\}}|dkr
|||���|||r!tjt	|����nt
���MdS)Nr5)rrVrGrHrrI)r�name_values_pairsrJr^r�s     rrSzAttribute._setattrs'
s���$�,�,�T�2�2�
�,�		�		�K�D�%��z�!�!��
�d�E�*�*�*�*��
���3�E�*�4��;�;�7�7�7�2�	����			�		r)
NNNFNNNNNNr')
rrr r!r)rr�r6r�r�r�r�rSrrrr�r�l	s�������)�)�V�I�<�
���������'5&�5&�5&�5&�n$�$�$��
�
�
��[�
�>���$
�
�
�3�3�3�����rr�c�n�g|]2}t|tddddd|dkddt|�������3S)NTFr5)r^r.r/r0r1r7r9r2r3r�r<)r�rr��r�r^s  rr�r�5
sg�����	
��
���
�����j� �
��%�d�+�+������r)rwc�(�g|]}|jdk�
|��Sr�r�r�s  rr�r�I
s$��6�6�6�Q���+� 5� 5�q� 5� 5� 5rc�6�g|]}|j�	|jdk�|��Sr�)r2r^r�s  rr�r�K
s+��
=�
=�
=��A�F�
=�q�v��'<�'<�1�'<�'<�'<rc��eZdZdZdZed�dD����eddddddddddddddd�	��fzZd
Zd�Z	d�Z
d
�ZdS)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�rOr0r7r8r9r:r2r3r5rNr4r+r6r;r<c#�vK�|]4}t|t|��tdddddddddddd���V��5dS)NTF�r^r<r.r/r0r1r2r3r6r7r8r9r:r�r;)r�r�rr_s  rr�z_CountingAttr.<genexpr>j
s|������$
�#	��)�$�/�/��������������	
�	
�	
������r)	r�rOr0r7r9r2r3r;r<r5NTFrdrc�$�txjdz
c_tj|_||_||_||_||_||_||_|
|_	||_
||_||_||_
|	|_|
|_||_||_dSr�)rG�cls_counterr�rOrNr4r0r7r8r9r:r2r3r5r+r6r;r<)rr.r/r0r1r2r3r4r5r+r6r7r8r9r:r;r<s                 rrz_CountingAttr.__init__�
s���&	�!�!�Q�&�!�!�$�0�����
�#���"�����	���������
�"�����	���	� ��
���	����$�����
�
�
rc�X�|j�||_nt|j|��|_|S)z�
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        )rNrF�rrzs  rr/z_CountingAttr.validator�
s-���?�"�"�D�O�O�"�4�?�D�9�9�D�O��rc�j�|jturt���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)rOrrrArhs  rr.z_CountingAttr.default�
s6���=��'�'�(�*�*�*����6�6�6��
��r)rrr r!r)rDr�r�rfrr/r.rrrrGrGO
s����������I�$�e���$

�%�����<	�	����������������	
�	
�	
�	�;/�O�`�K�#�#�#�J�������rrGc�*�eZdZdZdZdd�Zd�Zd�ZdS)	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*
    �rHr2Fc�"�||_||_dSr'rk)rrHr2s   rrzFactory.__init__�
s�����$����rc�D��t�fd��jD����S)rWc3�8�K�|]}t�|��V��dSr'r(rRs  �rr�z'Factory.__getstate__.<locals>.<genexpr>�
s-�����D�D�T�W�T�4�(�(�D�D�D�D�D�DrrYrs`rr�zFactory.__getstate__�
s*����D�D�D�D�T�^�D�D�D�D�D�Drc�^�t|j|��D]\}}t|||���dSr[)rWr)r)rrXr^r�s    rr�zFactory.__setstate__�
sB���t�~�u�5�5�	'�	'�K�D�%��D�$��&�&�&�&�	'�	'rN)F)rrr r!r)rr�r�rrrrArA�
sZ��������*�I�%�%�%�%�E�E�E�'�'�'�'�'rrAc�J�g|] }t|tdddddddd��
�
��!S)NTF)
r^r.r/r0r1r7r9r2r3r�)r�rr_s  rr�r�sW�����	
��
���
����
�
�������rc��
�t|t��r|}n8t|ttf��r
d�|D��}nt	d���|�dd��}|�dd��}|�dd��}i�
|�|�
d<|�|�
d<|�|�
d<t
j||i�
fd���}	tj	d��j
�d	d
��|_n#ttf$rYnwxYw|�dd��}	t|	|�d��|�d
��d��\|d<|d
<t!dd|i|��|��S)a�
    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 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.
    c�,�i|]}|t����Sr)rIr�s  rr&zmake_class.<locals>.<dictcomp>5s��/�/�/�A�A�v�x�x�/�/�/rz(attrs argument must be a dict or a list.r�Nr�rc�.��|����Sr')r3)rE�bodys �rr�zmake_class.<locals>.<lambda>Es����	�	�$���rrr�__main__r1r7r9Tr�r)rBrrCrDr>�poprG�	new_classr�	_getframe�	f_globalsr�rrr?r�r�)r^rw�bases�attributes_arguments�cls_dictrr�	user_init�type_r1rts          @r�
make_classrs����0�%����D����	�E�D�%�=�	)�	)�D�/�/��/�/�/����B�C�C�C��|�|�0�$�7�7�H����2�D�9�9�I����Z��.�.�I�
�D���%-��
!�"���&/��
"�#���$��Z���O�D�%��-G�-G�-G�-G�H�H�E�
��=��+�+�5�9�9��
�
�
�����
�J�'�
�
�
���
�����
"�
"�5�$�
/�
/�C�	"��� � ��&�&�� � ��)�)��		�	���T�"��W�%�:�6�9�9��9�$8�9�9�%�@�@�@s�2C9�9D
�D
)rr2c�,�eZdZdZe��Zd�ZdS)�
_AndValidatorz2
    Compose many validators to a single one.
    c�4�|jD]}||||���dSr')�_validators)rrr�r�r%s     r�__call__z_AndValidator.__call__ms5���!�	!�	!�A�
�A�d�D�%� � � � �	!�	!rN)rrr r!rIr�r�rrrr�r�es:���������&�(�(�K�!�!�!�!�!rr�c��g}|D]4}|�t|t��r|jn|g���5tt	|����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�rBr�r�rD)�
validatorsrBr/s   rrFrFrsh���D��
�
�	�����)�]�3�3�
�I�!�!���	
�	
�	
�	
���t���%�%�%rc� ���fd�}�stjd��}||d�|_nft�d�����}|r
||jd<t�d�����}|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�C��
r�A)r�r,rr�rVr,)�typing�TypeVarr�r	r4�get_return_type)r�r�r�r?�rts`    rrErE�s����������
:��N�3����12�a�)@�)@��&�&�
!��A��/�/�D�D�F�F���	6�45�N�*�5�1�"�*�R�.�
1�
1�
A�
A�
C�
C��
�	:�79�N�*�8�4��r)NrJ)T)NNNNNNNFFTFFFFFNNFFNNNTNr')NN)ZrRr"r[rrGr��operatorrrJrrrrr	r
r�
exceptionsrr
rr�objectr�rrr3r�r4rHrIr�rErrr�Enumrr�intr%rIrTrcrurvr�r�r�r�r�r�r�r�r�r�r=r�rwr�r�r�rar�rurtrr�rDr�r�rrr	rgrrr!r#r
r}r�r�r)�_arGrA�_frr�rFrrr�<module>r�s7��������������
�
�
�
�����
�
�
�
�������(�'�'�'�'�'�'�'�'�'��������������������������!��+��'����)��2�E�2�2�6�6��
�F�H�H�	�%���g�o�w�7G�H�H�������t�y����(�
���

(�
(�
(�
(�
(��
(�
(�
(�"
��	
��	
�	
�
�	
�����
��
�I�I�I�I�X � � � ����:"�"�"�:%�$�����
�
��0�0�0�"
�
�
� ���#�#�#�>%�%�%�8oG�oG�oG�d � � � � � �g�g�g�g�g�g�g�g�T���4&(�&(�&(�T.2�����6�
��	
��	
�	
�
���
����
��
��������1U�U�U�U�p
���/�/�/����GD�GD�GD�T������&%B�%B�%B�P5*�5*�5*�p
�
�
�
�6�6�6�r����%�%�%�P&�&�&�..�.�.�"'�'�'�K�K�K�H�H�H�V3�3�3�	�	�	�)�)�)����V�V�V�r�#��#�����F�F�F�F�F�F�F�F�R���#�����"
�I��G��	�)�2�&�&�&�6�6�"�6�6�6����>�
=�b�
=�
=�
=�
�
�
�	�O�O�O�O�O�O�O�O�d��	�	�-�0�0�1�1�
� '� '� '� '� '� '� '� '�F���!����� �)�G�G�I�I�g�R�8�8�8��C�C�C�2�
N�
N�
N��$*�)�DA�DA�DA�DA�V��T�����	!�	!�	!�	!�	!�	!�	!���	!�&�&�&�*$�$�$�$�$r

?>