403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/thirdparty/attr/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/thirdparty/attr/__pycache__/_make.cpython-39.opt-1.pyc
a

�+�bb��
@s�ddlmZmZmZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
mZmZddlmZmZmZejZdZd	Zd
Zei�ZGdd�de�Ze�Zedd
d
dd
difdd�Zdd�Zdd�Zdd�Z dd�Z!dBdd�Z"e�r�dd�Z#ndd�Z#dd�Z$dCd d!�Z%dDd"d#�Z&dEd$d%�Z'd&d'�Z(d(d)�Z)d*d+�Z*d,d-�Z+d.d/�Z,Gd0d1�d1e�Z-d2d3�e-j.D�Z/e%e&e'e-e/d4�e/d4�d5d3�e/D�d4�Z-Gd6d7�d7e�Z0e&e'e0��Z0e"d
dd8�Gd9d:�d:e��Z1effd;d<�Z2e"d
d
d=�Gd>d?�d?e��Z3d@dA�Z4dS)F�)�absolute_import�division�print_functionN)�
itemgetter�)�_config)�PY2�	iteritems�isclass�iterkeys�metadata_proxy)�DefaultAlreadySetError�FrozenInstanceError�NotAnAttrsClassErrorz__attr_convert_{}z__attr_factory_{}z/    {attr_name} = property(itemgetter({index}))c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�_Nothingz�
    Sentinel class to indicate the lack of a value when ``None`` is ambiguous.

    All instances of `_Nothing` are equal.
    cCs|S�N���selfrr�E/usr/lib64/python3.9/site-packages/mercurial/thirdparty/attr/_make.py�__copy__sz_Nothing.__copy__cCs|Srr)r�_rrr�__deepcopy__"sz_Nothing.__deepcopy__cCs
|jtkSr)�	__class__r�r�otherrrr�__eq__%sz_Nothing.__eq__cCs
||kSrrrrrr�__ne__(sz_Nothing.__ne__cCsdS)N�NOTHINGrrrrr�__repr__+sz_Nothing.__repr__cCsdS)Nl�>[=rrrrr�__hash__.sz_Nothing.__hash__N)
�__name__�
__module__�__qualname__�__doc__rrrrrr rrrrrsrTc
Cs8|dur |dur |dur td��t||||||||d�S)a�
    Create a new attribute on a class.

    ..  warning::

        Does *not* do anything unless the class is also decorated with
        :func:`attr.s`!

    :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 :class:`Factory`, its callable will be
        used to construct a new value (useful for mutable datatypes like lists
        or dicts).

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

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

    :type default: Any value.

    :param validator: :func:`callable` that is called by ``attrs``-generated
        ``__init__`` methods after the instance has been initialized.  They
        receive the initialized instance, the :class:`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
        :func:`get_run_validators`.

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

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

    :param bool repr: Include this attribute in the generated ``__repr__``
        method.
    :param bool cmp: Include this attribute in the generated comparison methods
        (``__eq__`` et al).
    :param hash: Include this attribute in the generated ``__hash__``
        method.  If ``None`` (default), mirror *cmp*'s value.  This is the
        correct behavior according the Python spec.  Setting this value to
        anything else than ``None`` is *discouraged*.
    :type hash: ``bool`` or ``None``
    :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 convert: :func:`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 :ref:`extending_metadata`.

    ..  versionchanged:: 17.1.0 *validator* can be a ``list`` now.
    ..  versionchanged:: 17.1.0
        *hash* is ``None`` and therefore mirrors *cmp* by default .
    NTF�6Invalid value for hash.  Must be True, False, or None.��default�	validator�repr�cmp�hash�init�convert�metadata)�	TypeError�
_CountingAttrr&rrr�attr8sF��r1cCsvd�|�}d�|�dg}|rDt|�D]\}}|�tj||d��q$n
|�d�dti}ttd�|�dd	�|�||S)
z�
    Create a tuple subclass to hold `Attribute`s for an `attrs` class.

    The subclass is a bare tuple with properties for names.

    class MyClassAttributes(tuple):
        __slots__ = ()
        x = property(itemgetter(0))
    z{}Attributeszclass {}(tuple):z    __slots__ = ())�index�	attr_namez    passr�
��exec)�format�	enumerate�append�_tuple_property_patr�eval�compile�join)�cls_name�
attr_namesZattr_class_nameZattr_class_template�ir3�globsrrr�_make_attr_tuple_class�s

��
rBc
s^g�t|jdd��D]0}t|dd�}|dur���fdd�|D��q|durfdd�|j��D�}nd	d�t|�D�}d
d�t|dd�d
�D�}dd��|D�}t|j	|�}|�dd�t|dd�d
�D��|_
d}|j
D]z}	|du�r|	�v�rt||	j|	�|du�r8|	j
tu�r8|	jdu�r8tdj|	d���q�|dur�|	j
tur�|	jdur�d}q�dS)z�
    Transforms all `_CountingAttr`s on a class into `Attribute`s and saves the
    list in `__attrs_attrs__`.

    If *these* is passed, use that and don't look for them on the class.
    r����__attrs_attrs__Nc3s|]}|�vr|VqdSrr��.0�a�Z	super_clsrr�	<genexpr>��z#_transform_attrs.<locals>.<genexpr>cSs"g|]\}}t|t�r||f�qSr��
isinstancer0�rF�namer1rrr�
<listcomp>�s
�z$_transform_attrs.<locals>.<listcomp>cSsg|]\}}||f�qSrr)rFrN�carrrrO�s�cSsg|]\}}tj||d��qS�)rNrP��	Attribute�from_counting_attr�rFr3rPrrrrO�s�cSs
|djS�Nr��counter��errr�<lambda>�rJz"_transform_attrs.<locals>.<lambda>)�keycSsg|]
}|j�qSr�rNrErrrrO�rJcSsg|]\}}tj||d��qSrQrRrUrrrrO�s�cSs
|djSrVrWrYrrrr[�rJFTzqNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: {a!r})rG)�reversed�__mro__�getattr�extend�__dict__�itemsr	�sortedrBr!rD�setattrrNr'rr,�
ValueErrorr7)
�cls�these�cZ	sub_attrs�ca_listZnon_super_attrsr?Z
AttrsClassZhad_defaultrGrrHr�_transform_attrs�sH���
�
"����rkcCs
t��dS)z4
    Attached to frozen classes as __setattr__.
    N�r�rrN�valuerrr�_frozen_setattrs�srocCs
t��dS)z4
    Attached to frozen classes as __delattr__.
    Nrl)rrNrrr�_frozen_delattrs�srpFc
	s4���������f	dd�}
|dur(|
S|
|�SdS)a�
    A class decorator that adds `dunder
    <https://wiki.python.org/moin/DunderAlias>`_\ -methods according to the
    specified attributes using :func:`attr.ib` or the *these* argument.

    :param these: A dictionary of name to :func:`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.

    :type these: :class:`dict` of :class:`str` to :func:`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 repr: Create a ``__repr__`` method with a human readable
        represantation of ``attrs`` attributes..
    :param bool str: Create a ``__str__`` method that is identical to
        ``__repr__``.  This is usually not necessary except for
        :class:`Exception`\ s.
    :param bool cmp: Create ``__eq__``, ``__ne__``, ``__lt__``, ``__le__``,
        ``__gt__``, and ``__ge__`` methods that compare the class as if it were
        a tuple of its ``attrs`` attributes.  But the attributes are *only*
        compared, if the type of both classes is *identical*!
    :param hash: If ``None`` (default), the ``__hash__`` method is generated
        according how *cmp* and *frozen* are set.

        1. If *both* are True, ``attrs`` will generate a ``__hash__`` for you.
        2. If *cmp* is True and *frozen* is False, ``__hash__`` will be set to
           None, marking it unhashable (which it is).
        3. If *cmp* is False, ``__hash__`` will be left untouched meaning the
           ``__hash__`` method of the superclass will be used (if superclass 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 the `Python documentation \
        <https://docs.python.org/3/reference/datamodel.html#object.__hash__>`_
        and the `GitHub issue that led to the default behavior \
        <https://github.com/python-attrs/attrs/issues/136>`_ for more details.
    :type hash: ``bool`` or ``None``
    :param bool init: Create a ``__init__`` method that initialiazes the
        ``attrs`` attributes.  Leading underscores are stripped for the
        argument name.  If a ``__attrs_post_init__`` method exists on the
        class, it will be called after the class is fully initialized.
    :param bool slots: Create a slots_-style class that's more
        memory-efficient.  See :ref:`slots` for further ramifications.
    :param bool frozen: Make instances immutable after initialization.  If
        someone attempts to modify a frozen instance,
        :exc:`attr.exceptions.FrozenInstanceError` is raised.

        Please note:

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

            2. True immutability is impossible in Python.

            3. This *does* have a minor a runtime performance :ref:`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)``.

        ..  _slots: https://docs.python.org/3.5/reference/datamodel.html#slots

    ..  versionadded:: 16.0.0 *slots*
    ..  versionadded:: 16.1.0 *frozen*
    ..  versionadded:: 16.3.0 *str*, and support for ``__attrs_post_init__``.
    ..  versionchanged::
            17.1.0 *hash* supports ``None`` as value which is also the default
            now.
    cs�t|dd�durtd���dur0�dur0td���r^�durRdd�|j��D�}ntt���}t|��t|�pr�}�dur�t	|�d�}�dur�|j
|_�dur�t|�}�durʈdurʈdur�td	��nR�dus�dur�dur�n8�du�s�du�r�du�r�du�rt
|�}nd|_�du�r0t||�}|du�rXt|_t|_�du�rXt|�}�du�r�t|j�}t|�|d
<|D]}|�|d��q||�dd�t|dd�}t|�|j|j|�}|du�r�||_|S)
Nrz(attrs only works with new-style classes.FTz3__str__ can only be generated if a __repr__ exists.cSsg|]\}}t|t�r|�qSrrKrMrrrrONs
�z,attributes.<locals>.wrap.<locals>.<listcomp>)�nsr%�	__slots__rbr#)r`r/rfrbrc�listrrk�_has_frozen_superclass�	_add_reprr�__str__�_add_cmp�	_add_hashr �	_add_initro�__setattr__rp�__delattr__�_add_pickle�dict�tuple�pop�typer!�	__bases__r#)rgrjZeffectively_frozen�cls_dictZca_name�qualname�	r*�frozenr+r,r)�repr_ns�slots�strrhrr�wrapBs^��
�(







zattributes.<locals>.wrapNr)Z	maybe_clsrhr�r)r*r+r,r�r�r�r�rr�r�
attributes�sUBr�cCs"t|jdd�tjko |jjtjkS)�b
        Check whether *cls* has a frozen ancestor by looking at its
        __setattr__.
        r"N)r`rzror"r!�rgrrrrt�s���rtcCs
|jtkS)r�)rzror�rrrrt�scst�fdd�|D��S)z:
    Create a tuple of all values of *obj*'s *attrs*.
    c3s|]}t�|j�VqdSr�r`rNrE��objrrrI�rJz"_attrs_to_tuple.<locals>.<genexpr>)r~)r��attrsrr�r�_attrs_to_tuple�sr�cs.�durdd�|jD���fdd�}||_|S)z%
    Add a hash method to *cls*.
    NcSs.g|]&}|jdus&|jdur|jdur|�qS)TN)r+r*rErrrrO�s�z_add_hash.<locals>.<listcomp>cstt|���S)�1
        Automatically created by attrs.
        )r+r�r�r�rr�hash_�sz_add_hash.<locals>.hash_)rDr )rgr�r�rr�rrx�s�rxcs��durdd�|jD���fdd���fdd���fdd	�}�fd
d�}�fdd
�}�fdd�}�fdd�}�|_||_||_||_||_||_|S)z*
    Add comparison methods to *cls*.
    NcSsg|]}|jr|�qSr)r*rErrrrO�rJz_add_cmp.<locals>.<listcomp>cs
t|��S)z&
        Save us some typing.
        )r�r�r�rr�attrs_to_tuple�sz _add_cmp.<locals>.attrs_to_tuplecs$|j|jur�|��|�kStSdS�r�N)r�NotImplementedr�r�rr�eq�sz_add_cmp.<locals>.eqcs �||�}|turtS|SdSr�)r�)rr�result)r�rr�ne�s
z_add_cmp.<locals>.necs$t||j�r�|��|�kStSdSr��rLrr�rr�rr�lt�sz_add_cmp.<locals>.ltcs$t||j�r�|��|�kStSdSr�r�rr�rr�le�sz_add_cmp.<locals>.lecs$t||j�r�|��|�kStSdSr�r�rr�rr�gt�sz_add_cmp.<locals>.gtcs$t||j�r�|��|�kStSdSr�r�rr�rr�ge�sz_add_cmp.<locals>.ge)rDrr�__lt__�__le__�__gt__�__ge__)rgr�r�r�r�r�r�r)r�r�r�rrw�s 	
				rwcs0�durdd�|jD����fdd�}||_|S)z%
    Add a repr method to *cls*.
    NcSsg|]}|jr|�qSr)r)rErrrrOrJz_add_repr.<locals>.<listcomp>csj�j}�dur<t|dd�}|dur4|�dd�d}qJ|j}n�d|j}d�|d��fd	d
��D���S)r�Nr#z>.rrC�.z{0}({1})�, c3s(|] }|jdtt�|j��VqdS)�=N)rNr)r`rErrrrIs�z+_add_repr.<locals>.repr_.<locals>.<genexpr>)rr`�rsplitr!r7r=)rZreal_clsr��
class_name�r�rqrr�repr_s��z_add_repr.<locals>.repr_)rDr)rgrqr�r�rr�rrus
rucCs�dd�|jD�}t��}t|�}t|t�s4|�d�}|�|�d�|�	��}t
||t|dd��\}}i}t||d�}	t
dd	�|D��}
|�t|
d
��|dur�t|d<t|	||�|d
}t|�d|�d�|ftj|<||_|S)zR
    Add a __init__ method to *cls*.  If *frozen* is True, make it immutable.
    cSs g|]}|js|jtur|�qSr)r,r'rrErrrrO)s�z_add_init.<locals>.<listcomp>zutf-8z<attrs generated init {0}>Z__attrs_post_init__Fr6css|]}|j|fVqdSrr]rErrrrI=rJz_add_init.<locals>.<genexpr>)r�	attr_dictTZ_cached_setattr�__init__N)rD�hashlib�sha1r)rL�bytes�encode�updater7�	hexdigest�_attrs_to_scriptr`r<r}r�_obj_setattrr;�len�
splitlines�	linecache�cacher�)rgr�r�r��rZunique_filenameZscriptrAZlocs�bytecoder�r,rrrry%s@


�
���
rycCs dd�}dd�}||_||_|S)zC
    Add pickle helpers, needed for frozen and slotted classes
    cst�fdd�t�j�D��S)�(
        Play nice with pickle.
        c3s|]}t�|j�VqdSrr�rEr�rrrI]rJz9_add_pickle.<locals>._slots_getstate__.<locals>.<genexpr>)r~�fieldsrr�rr�r�_slots_getstate__Ysz&_add_pickle.<locals>._slots_getstate__cSs6t�|t�}tt|j�|�D]\}}||j|�qdS)r�N)r��__get__rS�zipr�rrN)r��stateZ__bound_setattrrGrnrrr�_slots_setstate___sz&_add_pickle.<locals>._slots_setstate__)�__getstate__�__setstate__)rgr�r�rrrr|Us
r|cCs8t|�std��t|dd�}|dur4tdj|d���|S)a�
    Returns 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 attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
        class.

    :rtype: tuple (with name accesors) of :class:`attr.Attribute`

    ..  versionchanged:: 16.2.0 Returned tuple allows accessing the fields
        by name.
    zPassed object must be a class.rDNz({cls!r} is not an attrs-decorated class.r�)r
r/r`rr7)rgr�rrrr�ls
�r�cCsDtjdurdSt|j�D]&}|j}|dur|||t||j��qdS)z�
    Validate all attributes on *inst* that have a validator.

    Leaves all exceptions through.

    :param inst: Instance of a class with ``attrs`` attributes.
    FN)rZ_run_validatorsr�rr(r`rN)�instrG�vrrr�validate�s
r�c
Cs�g}|dur(|�d�dd�}dd�}ndd�}dd�}g}g}i}|D�]�}	|	jr^|�|	�|	j}
|	j�d	�}t|	jt�}|r�|	jjr�d
}
nd}
|	jdu�rj|�rt	�
|	j�}|	jd
ur�|�||
|d�
|
���t�
|	j�}|	j||<n|�||
|d�
|
���|	jj
||<nT|	jd
u�rP|�||
dj
|
d���t�
|	j�}|	j||<n|�||
dj
|
d���qH|	jtu�r�|�s�|�dj
||
d��|	jd
u�r�|�||
|��|	j|t�
|	j�<n|�||
|��qH|�r�|�dj
|d��|�dj
|d��t	�
|	j�}|	jd
u�rd|�d||
|��|�d�|�d||
|d�
|
���|	j|t�
|	j�<n<|�d||
|��|�d�|�d||
|d�
|
���|	jj
||<qH|�|�|	jd
u�r�|�||
|��|	j|t�
|	j�<qH|�||
|��qH|�r^t|d<|�d�|D]F}	d�
|	j�}d�
|	j�}
|�d�
||
|	j��|	j||<|	||
<�q|�rn|�d�dj
d�|�|�r�d �|�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__``.
    Tz8_setattr = _cached_setattr.__get__(self, self.__class__)cSsd||d�S)Nz(_setattr('%(attr_name)s', %(value_var)s)�r3�	value_varrr�rrr�
fmt_setter�s�z$_attrs_to_script.<locals>.fmt_settercSst�|�}d|||d�S)Nz2_setattr('%(attr_name)s', %(conv)s(%(value_var)s))�r3r��conv��_init_convert_patr7�r3r��	conv_namerrr�fmt_setter_with_converter�s
�z3_attrs_to_script.<locals>.fmt_setter_with_convertercSsd||d�S)Nzself.%(attr_name)s = %(value)s�r3rnrr�rrrr��s�cSst�|�}d|||d�S)Nz,self.%(attr_name)s = %(conv)s(%(value_var)s)r�r�r�rrrr��s
�rrr5FNz({0})z attr_dict['{attr_name}'].default)r3z+{arg_name}=attr_dict['{attr_name}'].default)�arg_namer3z{arg_name}=NOTHING)r�zif {arg_name} is not NOTHING:z    zelse:rz#if _config._run_validators is True:z__attr_validator_{}z	__attr_{}z    {}(self, {}, self.{})zself.__attrs_post_init__()z(def __init__(self, {args}):
    {lines}
r�z
    �pass)�args�lines)r9r(rN�lstriprLr'�Factory�
takes_selfr,�_init_factory_patr7r-r��factoryrrr=)r�r�Z	post_initr�r�r�r�Zattrs_to_validateZnames_for_globalsrGr3r�Zhas_factoryZ
maybe_selfZinit_factory_namer�Zval_namerrrr��s�	�



���������
�
�
�

�

��r�c@sBeZdZdZdZddd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dS)rSz�
    *Read-only* representation of an attribute.

    :attribute name: The name of the attribute.

    Plus *all* arguments of :func:`attr.ib`.
    )	rNr'r(r)r*r+r,r-r.Nc
Csvt�|t�}
|
d|�|
d|�|
d|�|
d|�|
d|�|
d|�|
d|�|
d|�|
d	|	rlt|	�nt�dS)
NrNr'r(r)r*r+r,r-r.)r�r�rSr�_empty_metadata_singleton)rrNr'r(r)r*r+r,r-r.�
bound_setattrrrrr�Bs







�zAttribute.__init__cCs
t��dSrrlrmrrrrzRszAttribute.__setattr__cs.�fdd�tjD�}|f|�j�jd�|��S)Ncs i|]}|dvr|t�|��qS)�rNr(r')r`)rF�k�rPrr�
<dictcomp>Ws�z0Attribute.from_counting_attr.<locals>.<dictcomp>r�)rSrr�
_validator�_default)rgrNrPZ	inst_dictrr�rrTUs
��zAttribute.from_counting_attrcst�fdd��jD��S)r�c3s*|]"}|dkrt�|�nt�j�VqdS)r.N)r`r}r.�rFrNrrrrIgs�z)Attribute.__getstate__.<locals>.<genexpr>)r~rrrrrrr�cs�zAttribute.__getstate__cCsPt�|t�}t|j|�D]2\}}|dkr4|||�q|||rDt|�nt�qdS)r�r.N)r�r�rSr�rrrr�)rr�r�rNrnrrrr�ks�zAttribute.__setstate__)NN)r!r"r#r$rrr�rz�classmethodrTr�r�rrrrrS5s�


rScCs&g|]}t|tddd|dkdd��qS)NTr.�rNr'r(r)r*r+r,�rSrr�rrrrOxs��rOr�cCsg|]}|jr|�qSr)r+rErrrrO~rJc
@sZeZdZdZdZedd�dD��edddddd	dd
�fZdZdd
�Z	dd�Z
dd�ZdS)r0a
    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.
    )	rXr�r)r*r+r,r.r�r-c
cs$|]}t|tdddddd�VqdS)NTr�r�r�rrrrI�s��z_CountingAttr.<genexpr>)rXr�r)r*r+r,r.NTFr�rc		Cshtjd7_tj|_||_|r:t|ttf�r:t|�|_n||_||_	||_
||_||_||_
||_dSrV)r0�cls_counterrXr�rLrsr~�and_r�r)r*r+r,r-r.)	rr'r(r)r*r+r,r-r.rrrr��sz_CountingAttr.__init__cCs$|jdur||_nt|j|�|_|S)z�
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        N)r�r��r�methrrrr(�s
z_CountingAttr.validatorcCs"|jturt��t|dd�|_|S)z�
        Decorator that allows to set the default for an attribute.

        Returns *meth* unchanged.

        :raises DefaultAlreadySetError: If default has been set before.

        .. versionadded:: 17.1.0
        T)r�)r�rr
r�r�rrrr'�s

z_CountingAttr.default)r!r"r#r$rrr~rSrDr�r�r(r'rrrrr0�s����	r0)r�r,c@s&eZdZdZe�Ze�Zddd�ZdS)r�a�
    Stores a factory callable.

    If passed as the default value to :func:`attr.ib`, 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*
    FcCs||_||_dS)z�
        `Factory` is part of the default machinery so if we want a default
        value here, we have to implement it ourselves.
        N)r�r�)rr�r�rrrr��szFactory.__init__N)F)r!r"r#r$r1r�r�r�rrrrr��s
r�cKsTt|t�r|}n*t|ttf�r2tdd�|D��}ntd��tfi|��t|||��S)a
    A quick way to create a new class called *name* with *attrs*.

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

    :param attrs: A list of names or a dictionary of mappings of names to
        attributes.
    :type attrs: :class:`list` or :class:`dict`

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

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

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

    ..  versionadded:: 17.1.0 *bases*
    css|]}|t�fVqdSr)r1rErrrrI�rJzmake_class.<locals>.<genexpr>z(attrs argument must be a dict or a list.)rLr}rsr~r/r�r�)rNr��basesZattributes_argumentsr�rrr�
make_class�s
r�)r�r+c@seZdZdZe�Zdd�ZdS)�
_AndValidatorz2
    Compose many validators to a single one.
    cCs|jD]}||||�qdSr)�_validators)rr�r1rnr�rrr�__call__s
z_AndValidator.__call__N)r!r"r#r$r1r�r�rrrrr�sr�cGs6g}|D] }|�t|t�r |jn|g�qtt|��S)z�
    A validator that composes multiple validators into one.

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

    :param validators: Arbitrary number of validators.
    :type validators: callables

    .. versionadded:: 17.1.0
    )rarLr�r�r~)Z
validatorsZvalsr(rrrr�s�r�)
NNNTTNTFFF)N)N)NN)5Z
__future__rrrr�r��operatorrr5rZ_compatrr	r
rr�
exceptionsr
rr�objectrzr�r�r�r:r�rrr1rBrkrorpr�rtr�rxrwruryr|r�r�r�rSrrZ_ar0r�r�r�r�rrrr�<module>sn�
V5�



N
0C��F
"


Youez - 2016 - github.com/yon3zu
LinuXploit