[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.119.138.124: ~ $
U

#IGZ���@sdddlmZmZmZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZmZmZmZddlmZmZmZmZejZdZd	Zd
Zei�ZGdd�de�Ze�Zedd
d
dd
ddddf
dd�Z dd�Z!e!dddg�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'Gdd �d e�Z(dRd"d�Z)e)Z*e
�r:d#d$�Z+nd%d$�Z+d&d'�Z,d(d)�Z-d*d+�Z.d,d-�Z/d.d/�Z0dSd0d1�Z1d2d3�Z2dTd4d5�Z3d6d7�Z4d8d9�Z5d:d;�Z6d<d=�Z7d>d?�Z8Gd@dA�dAe�Z9dBdC�e9j:D�Z;e.e1e3e9e;dD�e;dD�dEdC�e;D�dD�Z9GdFdG�dGe�Z<e1e3e<��Z<e)d
d!d
dH�GdIdJ�dJe��Z=effdKdL�Z>e)d
d
dM�GdNdO�dOe��Z?dPdQ�Z@dS)U�)�absolute_import�division�print_functionN)�
itemgetter�)�_config)�PY2�isclass�	iteritems�metadata_proxy�set_closure_cell)�DefaultAlreadySetError�FrozenInstanceError�NotAnAttrsClassError�UnannotatedAttributeErrorz__attr_converter_{}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�	/_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__rrrrr r!rrrrrsrTc

Csr|dk	r |dk	r |dk	r td��|dk	rL|	dk	r8td��tjdtdd�|}	|dkrXi}t|||||||	||d	�	S)
aJ
    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 data types 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 converter: :func:`callable` that is called by
        ``attrs``-generated ``__init__`` methods to converter 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`.
    :param type: The type of the attribute.  In Python 3.6 or greater, the
        preferred method to specify the type is using a variable annotation
        (see `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_).
        This argument is provided for backward compatibility.
        Regardless of the approach used, the type will be stored on
        ``Attribute.type``.

    .. 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 *cmp* 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.
    NTF�6Invalid value for hash.  Must be True, False, or None.�HCan't pass both `convert` and `converter`.  Please use `converter` only.�`The `convert` argument is deprecated in favor of `converter`.  It will be removed after 2019/01.���
stacklevel)	�default�	validator�repr�cmp�hash�init�	converter�metadata�type)�	TypeError�RuntimeError�warnings�warn�DeprecationWarning�
_CountingAttr)
r,r-r.r/r0r1�convertr3r4r2rrr�attrib9s8R����r<cCsvd�|�}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)Zcls_name�
attr_namesZattr_class_nameZattr_class_template�ir>�globsrrr�_make_attr_tuple_class�s

��
rL�_Attributes�attrs�super_attrscCst|��d�S)z�
    Check whether *annot* is a typing.ClassVar.

    The implementation is gross but importing `typing` is slow and there are
    discussions to remove it from the stdlib alltogether.
    ztyping.ClassVar)�str�
startswith)Zannotrrr�
_is_class_var�srRcCsHt|dd�}|dkriS|jdd�D]}|t|dd�kr&iSq&|S)z$
    Get annotations for *cls*.
    �__annotations__Nr)�getattr�__mro__)�cls�anns�	super_clsrrr�_get_annotations�s
rYc	sL|j�t|��|dk	r6tdd�t|�D�dd�d�}n�|dkr�dd	����D�}g}t�}���D]Z\}}t|�rtqb|�|���|t	�}t
|t�s�|t	kr�t�}n
t|d
�}|�
||f�qb||}	t|	�dkr�tdd
�t|	�fdd�d��d��ntdd����D�dd�d�}�fdd�|D�}
g}dd�|
D�}|jdd�D]R}
t|
dd�}|dk	�rJ|D]0}|�|j�}|dk�rh|�
|�|||j<�qh�qJdd�||
D�}t|j|�}||�fdd�|D��}d}|D]`}|dk�r|jt	k�r|jdk�rtdj|d���n&|dk�r�|jt	k	�r�|jdk	�r�d}�q�t||f�S)z�
    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.

    Return an `_Attributes`.
    Ncss|]\}}||fVqdSrr)�.0�name�carrr�	<genexpr>�s�z#_transform_attrs.<locals>.<genexpr>cSs
|djS�Nr��counter��errr�<lambda>��z"_transform_attrs.<locals>.<lambda>)�keyTcSsh|]\}}t|t�r|�qSr��
isinstancer:�rZr[�attrrrr�	<setcomp>�s
�z#_transform_attrs.<locals>.<setcomp>)r,rz1The following `attr.ib`s lack a type annotation: �, cs��|�jSr)�getr`)�n)�cdrrrcrd�.css$|]\}}t|t�r||fVqdSrrfrhrrrr]s
�cSs
|djSr^r_rarrrrc rdcs&g|]\}}tj||��|�d��qS�)r[r\r4��	Attribute�from_counting_attrrl�rZr>r\�rWrr�
<listcomp>"s��z$_transform_attrs.<locals>.<listcomp>cSsi|]}|j|�qSr�r[�rZ�arrr�
<dictcomp>-sz$_transform_attrs.<locals>.<dictcomp>r����__attrs_attrs__cSsg|]
}|j�qSrrwrxrrrrv;scs&g|]\}}tj||��|�d��qSrprqrtrurrrv@s��FzqNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: {a!r})ry)�__dict__rY�sortedr
�items�setrR�addrlrrgr:r<rD�lenrrHrUrTr[rLr"r,r1�
ValueErrorrBrM)rV�these�auto_attribsZca_listZca_namesZannot_namesr>r4ryZunannotatedZ	own_attrsrOZtaken_attr_namesrXZ	sub_attrsZprev_arIZ
AttrsClassrNZhad_defaultr)rWrnr�_transform_attrs�s����



������
�



��"��
��r�cCs
t��dS)z4
    Attached to frozen classes as __setattr__.
    N�r�rr[�valuerrr�_frozen_setattrs[sr�cCs
t��dS)z4
    Attached to frozen classes as __delattr__.
    Nr�)rr[rrr�_frozen_delattrsbsr�c@steZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�
_ClassBuilderz(
    Iteratively build *one* class.
    )�_cls�	_cls_dict�_attrs�_super_names�_attr_names�_slots�_frozen�_has_post_initcCs�t|||�\}}||_|r$t|j�ni|_||_tdd�|D��|_tdd�|D��|_	||_
|pht|�|_t
t|dd��|_|j|jd<|r�t|jd<t|jd<dS)	Ncss|]}|jVqdSrrwrxrrrr]xsz)_ClassBuilder.__init__.<locals>.<genexpr>css|]}|jVqdSrrwrxrrrr]ys�__attrs_post_init__Fr|�__setattr__�__delattr__)r�r��dictr}r�r�r�r��tupler�r��_has_frozen_superclassr��boolrTr�r�r�)rrVr��slots�frozenr�rNrOrrr�__init__rs
z_ClassBuilder.__init__cCsdj|jjd�S)Nz<_ClassBuilder(cls={cls})>�rV)rBr�r"rrrrr �sz_ClassBuilder.__repr__cCs|jdkr|��S|��SdS)z�
        Finalize class based on the accumulated configuration.

        Builder cannot be used anymore after calling this method.
        TN)r��_create_slots_class�_patch_original_classrrrr�build_class�s
z_ClassBuilder.build_classcCs^|j}|j}|jD]&}||krt||d�dk	rt||�q|j��D]\}}t|||�qD|S)zA
        Apply accumulated methods and return the class.
        N)r�r�r�rT�delattrr�r�setattr)rrV�super_namesr[r�rrrr��s
�z#_ClassBuilder._patch_original_classc	s�j��fdd�t�j�D�}t�fdd��jD��|d<t�jdd�}|dk	rX||d<t�j���fdd	�}�fd
d�}||d<||d
<t�j��jj�jj	|�}|j
��D]T}t|t
tf�r�t|jdd�}nt|dd�}|s�q�|D]}|j�jkr�t||�q�q�|S)zL
        Build and return a new class with a `__slots__` attribute.
        cs(i|] \}}|t�j�dkr||�qS))r})r�r�)rZ�k�vrrrrz�s�z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>c3s|]}|�kr|VqdSrr�rZr[)r�rrr]�s�z4_ClassBuilder._create_slots_class.<locals>.<genexpr>�	__slots__r$Ncst�fdd��D��S)�9
            Automatically created by attrs.
            c3s|]}t�|�VqdSr�rTr�rrrr]�szL_ClassBuilder._create_slots_class.<locals>.slots_getstate.<locals>.<genexpr>�r�r�rIrr�slots_getstate�sz9_ClassBuilder._create_slots_class.<locals>.slots_getstatecs.t�|t�}t�|�D]\}}|||�qdS)r�N)�_obj_setattr�__get__rr�zip)r�stateZ_ClassBuilder__bound_setattrr[r�r�rr�slots_setstate�sz9_ClassBuilder._create_slots_class.<locals>.slots_setstate�__getstate__�__setstate__�__closure__)r�r
r�r�r�rTr�r4r"�	__bases__r}�valuesrg�classmethod�staticmethod�__func__�
cell_contentsr)	rrn�qualnamer�r�rV�itemZ
closure_cellsZcellr)rIrr�rr��s<
��
	�z!_ClassBuilder._create_slots_classcCs|�t|j|d��|jd<|S)N)�nsr )�_add_method_dunders�
_make_reprr�r�)rr�rrr�add_repr�s�
z_ClassBuilder.add_reprcCs8|j�d�}|dkrtd��dd�}|�|�|jd<|S)Nr z3__str__ can only be generated if a __repr__ exists.cSs|��Sr)r rrrr�__str__�sz&_ClassBuilder.add_str.<locals>.__str__r�)r�rlr�r�)rr.r�rrr�add_str�s�z_ClassBuilder.add_strcCsd|jd<|S�Nr!)r�rrrr�make_unhashables
z_ClassBuilder.make_unhashablecCs|�t|j��|jd<|Sr�)r��
_make_hashr�r�rrrr�add_hashs�
z_ClassBuilder.add_hashcCs"|�t|j|j|j��|jd<|S)Nr�)r��
_make_initr�r�r�r�rrrr�add_inits��
z_ClassBuilder.add_initcsF�j}�fdd�t�j�D�\|d<|d<|d<|d<|d<|d<�S)	Nc3s|]}��|�VqdSr)r�)rZ�methrrrr]s�z(_ClassBuilder.add_cmp.<locals>.<genexpr>rr�__lt__�__le__�__gt__�__ge__)r��	_make_cmpr�)rrnrrr�add_cmps
�� z_ClassBuilder.add_cmpcCsXz|jj|_Wntk
r"YnXzd�|jj|jf�|_Wntk
rRYnX|S)zL
        Add __module__ and __qualname__ to a *method* if possible.
        ro)r�r#�AttributeErrorrHr$r")r�methodrrrr�!s�
z!_ClassBuilder._add_method_dundersN)r"r#r$r%r�r�r r�r�r�r�r�r�r�r�r�r�rrrrr�isH
r�Fc
s6����������	f
dd�}|dkr*|S||�SdS)aU
    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
        representation 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 initializes 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/reference/datamodel.html#slots
    :param bool auto_attribs: If True, collect `PEP 526`_-annotated attributes
        (Python 3.6 and later only) from the class body.

        In this case, you **must** annotate every field.  If ``attrs``
        encounters a field that is set to an :func:`attr.ib` but lacks a type
        annotation, an :exc:`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 :class:`Factory` also
        works as expected.

        Attributes annotated as :data:`typing.ClassVar` are **ignored**.

        .. _`PEP 526`: https://www.python.org/dev/peps/pep-0526/

    ..  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.
    .. versionadded:: 17.3.0 *auto_attribs*
    cs�t|dd�dkrtd��t|�	����}�dkr:|����dkrJ|���dkrZ|���dk	r|�dk	r|�dk	r|td��nL�dksȈdkr��dkr�n2�dks��dkr��dkr��dkr�|��n|���dkr�|��|�	�S)Nrz(attrs only works with new-style classes.TFr&)
rTr5r�r�r�r�r�r�r�r�)rVZbuilder�
r�r/r�r0r1r.�repr_nsr�rPr�rr�wrap�s*
� 
zattrs.<locals>.wrapNr)Z	maybe_clsr�r�r.r/r0r1r�r�rPr�r�rr�rrN4sg cCs"t|jdd�tjko |jjtjkS)�b
        Check whether *cls* has a frozen ancestor by looking at its
        __setattr__.
        r#N)rTr�r�r#r"r�rrrr��s���r�cCs
|jtkS)r�)r�r�r�rrrr��scst�fdd�|D��S)z:
    Create a tuple of all values of *obj*'s *attrs*.
    c3s|]}t�|j�VqdSr)rTr[rx��objrrr]�sz"_attrs_to_tuple.<locals>.<genexpr>r�)r�rNrr�r�_attrs_to_tuple�sr�c
Cs�tdd�|D��}t��}|�t|��d��d|��f}t|�}ddd|fg}|D]}|�d|j	�qX|�d	�d
�
|�}i}i}t||d�}	t|	||�t
|�d|�d�|ftj|<|d
S)Ncss0|](}|jdks$|jdkr|jdkr|VqdS)TN)r0r/rxrrrr]�s



�z_make_hash.<locals>.<genexpr>�utf-8z<attrs generated hash %s>zdef __hash__(self):z    return hash((z        %d,�        self.%s,z    ))r?rATr!)r��hashlib�sha1�updater.�encode�	hexdigestr0rDr[rHrGrFr��
splitlines�	linecache�cache)
rNr��unique_filenameZ	type_hash�linesry�scriptrK�locs�bytecoderrrr��s2��

�
r�cCst|�|_|S)z%
    Add a hash method to *cls*.
    )r�r!�rVrNrrr�	_add_hashs
r�cCs|�|�}|tkrtS|S)z^
    Check equality and either forward a NotImplemented or return the result
    negated.
    )r�NotImplemented)rr�resultrrrrs
rcs<dd��D��t��}|�t���d��d|��f}dddg}�r�|�d�d	g}�D](}|�d
|jf�|�d|jf�qZ||dg7}n
|�d
�d�|�}i}i}t	||d�}	t
|	||�t|�d|�d�|ft
j|<|d}
t}�fdd���fdd�}�fdd�}
�fdd�}�fdd�}|
|||
||fS)NcSsg|]}|jr|�qSr)r/rxrrrrv!sz_make_cmp.<locals>.<listcomp>r�z<attrs generated eq %s>zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz
    return  (z
    ) == (r�z        other.%s,z    )z    return Truer?rATrcs
t|��S)z&
        Save us some typing.
        )r�r��rNrr�attrs_to_tupleLsz!_make_cmp.<locals>.attrs_to_tuplecs$t||j�r�|��|�kStSdS��1
        Automatically created by attrs.
        N�rgrr�r�r�rrr�Rsz_make_cmp.<locals>.__lt__cs$t||j�r�|��|�kStSdSr�r�rr�rrr�[sz_make_cmp.<locals>.__le__cs$t||j�r�|��|�kStSdSr�r�rr�rrr�dsz_make_cmp.<locals>.__gt__cs$t||j�r�|��|�kStSdSr�r�rr�rrr�msz_make_cmp.<locals>.__ge__)r�r�r�r.r�r�rDr[rHrGrFr�r�r�r�r)rNr�r�r�Zothersryr�rKr�r��eq�ner�r�r�r�r)rNr�rr� sF�
�

�
				r�cCs2|dkr|j}t|�\|_|_|_|_|_|_|S)z*
    Add comparison methods to *cls*.
    N)r|r�rrr�r�r�r�r�rrr�_add_cmpys
�r�cs$tdd�|D�����fdd�}|S)zK
    Make a repr method for *attr_names* adding *ns* to the full name.
    css|]}|jr|jVqdSr)r.r[rxrrrr]�s�z_make_repr.<locals>.<genexpr>csj�j}�dkr<t|dd�}|dk	r4|�dd�d}qJ|j}n�d|j}d�|d��fd	d
��D���S)r�Nr$z>.rr{roz{0}({1})rkc3s&|]}|dtt�|t��VqdS)�=N)r.rTrr�rrrr]�s�z/_make_repr.<locals>.__repr__.<locals>.<genexpr>)rrT�rsplitr"rBrH)rZreal_clsr��
class_name�rIr�rrr �s��z_make_repr.<locals>.__repr__r�)rNr�r rr�rr��s
�r�cCs|dkr|j}t||�|_|S)z%
    Add a repr method to *cls*.
    N)r|r�r )rVr�rNrrr�	_add_repr�sr�c
Cs�dd�|D�}t��}|�t|��d��d�|���}t|||�\}}i}t||d�}t	dd�|D��}	|�t
|	d��|d	kr�t|d
<t|||�t
|�d|�d	�|ftj|<|dS)NcSs g|]}|js|jtk	r|�qSr)r1r,rrxrrrrv�s
�z_make_init.<locals>.<listcomp>r�z<attrs generated init {0}>rAcss|]}|j|fVqdSrrwrxrrrr]�sz_make_init.<locals>.<genexpr>)r�	attr_dictTZ_cached_setattrr�)r�r�r�r.r�rBr��_attrs_to_init_scriptrGr�rr�rFr�r�r�r�)
rN�	post_initr�r�r�r�rKr�r�r�rrrr��s:�����
r�cCst|jt|dd�|�|_|S)zR
    Add a __init__ method to *cls*.  If *frozen* is True, make it immutable.
    r�F)r�r|rTr�)rVr�rrr�	_add_init�s
�r�cCs8t|�std��t|dd�}|dkr4tdj|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 accessors) of :class:`attr.Attribute`

    ..  versionchanged:: 16.2.0 Returned tuple allows accessing the fields
        by name.
    zPassed object must be a class.r|Nz({cls!r} is not an attrs-decorated class.r�)r	r5rTrrBr�rrr�fields�s
�rcCsDtjdkrdSt|j�D]&}|j}|dk	r|||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_validatorsrrr-rTr[)�instryr�rrr�validates
rc
Cs�g}|dkr(|�d�dd�}dd�}ndd�}dd�}g}g}i}|D�]�}	|	jr^|�|	�|	j}
|	j�d	�}t|	jt�}|r�|	jjr�d
}
nd}
|	jdk�rj|�rt	�
|	j�}|	jd
k	r�|�||
|d�
|
���t�
|	j�}|	j||<n|�||
|d�
|
���|	jj
||<nT|	jd
k	�rP|�||
dj
|
d���t�
|	j�}|	j||<n|�||
dj
|
d���qH|	jtk	�r�|�s�|�dj
||
d��|	jd
k	�r�|�||
|��|	j|t�
|	j�<n|�||
|��qH|�r�|�dj
|d��|�dj
|d��t	�
|	j�}|	jd
k	�rd|�d||
|��|�d�|�d||
|d�
|
���|	j|t�
|	j�<n<|�d||
|��|�d�|�d||
|d�
|
���|	jj
||<qH|�|�|	jd
k	�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)�r>�	value_varrrrrr�
fmt_setter)s�z)_attrs_to_init_script.<locals>.fmt_settercSst�|�}d|||d�S)Nz2_setattr('%(attr_name)s', %(conv)s(%(value_var)s))�r>rZconv��_init_converter_patrB�r>r�	conv_namerrr�fmt_setter_with_converter/s
�z8_attrs_to_init_script.<locals>.fmt_setter_with_convertercSsd||d�S)Nzself.%(attr_name)s = %(value)s�r>r�rrrrrr7s�cSst�|�}d|||d�S)Nz,self.%(attr_name)s = %(conv)s(%(value_var)s)rrr	rrrr=s
�rrr@FNz({0})z attr_dict['{attr_name}'].default)r>z+{arg_name}=attr_dict['{attr_name}'].default)�arg_namer>z{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}
rkz
    �pass)�argsr�)rDr-r[�lstriprgr,�Factory�
takes_selfr1�_init_factory_patrBr2r�factoryrrrH)rNr�r�r�rrrZattrs_to_validateZnames_for_globalsryr>r
Zhas_factoryZ
maybe_selfZinit_factory_namer
Zval_namerrrr�s�	�



�����������
��
�
�
�

��r�c@sPeZdZdZdZddd�Zdd�Zedd	��Ze	dd
d��Z
dd
�Zdd�ZdS)rrz�
    *Read-only* representation of an attribute.

    :attribute name: The name of the attribute.

    Plus *all* arguments of :func:`attr.ib`.

    For the version history of the fields, see :func:`attr.ib`.
    )
r[r,r-r.r/r0r1r3r4r2Nc
Cs�t�|t�}|dk	r8|dk	r$td��tjdtdd�|}|d|�|d|�|d|�|d|�|d	|�|d
|�|d|�|d|�|d
|	r�t|	�nt�|d|
�dS)Nr'r(r)r*r[r,r-r.r/r0r1r2r3r4)	r�r�rrr6r7r8r9r�_empty_metadata_singleton)
rr[r,r-r.r/r0r1r;r3r4r2�
bound_setattrrrrr��s2��







�zAttribute.__init__cCs
t��dSrr�r�rrrr��szAttribute.__setattr__cCstjdtdd�|jS)NzaThe `convert` attribute is deprecated in favor of `converter`.  It will be removed after 2019/01.r)r*)r7r8r9r2rrrrr;�s�zAttribute.convertcsR|dkr�j}n�jdk	r"td���fdd�tjD�}|f|�j�j|d�|��S)Nz8Type annotation and type argument cannot both be presentcs i|]}|dkr|t�|��qS))r[r-r,r4r;r�)rZr��r\rrrzs�z0Attribute.from_counting_attr.<locals>.<dictcomp>)r[r-r,r4)r4r�rrr��
_validator�_default)rVr[r\r4Z	inst_dictrrrrs�s"
�
���zAttribute.from_counting_attrcst�fdd��jD��S)�(
        Play nice with pickle.
        c3s*|]"}|dkrt�|�nt�j�VqdS)r3N)rTr�r3r�rrrr]s�z)Attribute.__getstate__.<locals>.<genexpr>)r�r�rrrrr�s�zAttribute.__getstate__cCsPt�|t�}t|j|�D]2\}}|dkr4|||�q|||rDt|�nt�qdS)rr3N)r�r�rrr�r�rr)rr�rr[r�rrrr�s�zAttribute.__setstate__)NNNN)N)
r"r#r$r%r�r�r��propertyr;r�rsr�r�rrrrrr�s	�
"
rrcCs.g|]&}|dkrt|tddd|dkdd��qS)r;NTr3�r[r,r-r.r/r0r1�rrrr�rrrrv$s��rvr�cCsg|]}|jr|�qSr)r0rxrrrrv-sc
@sZeZdZdZdZedd�dD��edddddd	dd
�fZdZdd
�Z	dd�Z
dd�ZdS)r:a
    Intermediate representation of attributes that uses a counter to preserve
    the order in which the attributes have been defined.

    *Internal* data structure of the attrs library.  Running into is most
    likely the result of a bug like a forgotten `@attr.s` decorator.
    )
r`rr.r/r0r1r3rr2r4c
cs$|]}t|tdddddd�VqdS)NTrrr�rrrr];s��z_CountingAttr.<genexpr>)r`rr.r/r0r1r3NTFrrc

Csntjd7_tj|_||_|r:t|ttf�r:t|�|_n||_||_	||_
||_||_||_
||_|	|_dSr^)r:�cls_counterr`rrg�listr��and_rr.r/r0r1r2r3r4)
rr,r-r.r/r0r1r2r3r4rrrr�Fsz_CountingAttr.__init__cCs$|jdkr||_nt|j|�|_|S)z�
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        N)rr �rr�rrrr-Xs
z_CountingAttr.validatorcCs"|jtk	rt��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)rrr
rr!rrrr,fs

z_CountingAttr.default)r"r#r$r%r�r�rrr|rr�r-r,rrrrr:1s"����	r:)r�r1r0c@s&eZdZdZe�Ze�Zddd�ZdS)ra�
    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)rr)rrrrrrr��szFactory.__init__N)F)r"r#r$r%r<rrr�rrrrr{s
rc	Ks�t|t�r|}n*t|ttf�r2tdd�|D��}ntd��|�dd�}t|||dkrXind|i�}zt�d�j	�
dd�|_Wntt
fk
r�YnXtfd	|i|��|�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)r<rxrrrr]�szmake_class.<locals>.<genexpr>z(attrs argument must be a dict or a list.r�Nrr"�__main__r�)rgr�rr�r5�popr4�sys�	_getframe�	f_globalsrlr#r�r�r�)r[rN�basesZattributes_argumentsZcls_dictr�Ztype_rrr�
make_class�s&
�	�
r()r�r0c@seZdZdZe�Zdd�ZdS)�
_AndValidatorz2
    Compose many validators to a single one.
    cCs|jD]}||||�qdSr)�_validators)rrrir�r�rrr�__call__�s
z_AndValidator.__call__N)r"r#r$r%r<r*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
    )�extendrgr)r*r�)Z
validatorsZvalsr-rrrr �s�r )NNNTTNTFFFF)N)NN)AZ
__future__rrrr�r�r$r7�operatorrr@rZ_compatrr	r
rr�
exceptionsr
rrr�objectr�r�rrrErrrr<rLrMrRrYr�r�r�r�rNr�r�r�r�r�rr�r�r�r�r�r�rrr�rrr�Z_ar:rr(r)r rrrr�<module>s��
t�
pL�

(Y

"
,$i��G3


Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 1.27 KB 0644
__init__.cpython-38.pyc File 1.27 KB 0644
_compat.cpython-38.opt-1.pyc File 4.02 KB 0644
_compat.cpython-38.pyc File 4.02 KB 0644
_config.cpython-38.opt-1.pyc File 676 B 0644
_config.cpython-38.pyc File 676 B 0644
_funcs.cpython-38.opt-1.pyc File 6.6 KB 0644
_funcs.cpython-38.pyc File 6.6 KB 0644
_make.cpython-38.opt-1.pyc File 40.08 KB 0644
_make.cpython-38.pyc File 40.08 KB 0644
converters.cpython-38.opt-1.pyc File 779 B 0644
converters.cpython-38.pyc File 779 B 0644
exceptions.cpython-38.opt-1.pyc File 1.73 KB 0644
exceptions.cpython-38.pyc File 1.73 KB 0644
filters.cpython-38.opt-1.pyc File 1.7 KB 0644
filters.cpython-38.pyc File 1.7 KB 0644
validators.cpython-38.opt-1.pyc File 5.44 KB 0644
validators.cpython-38.pyc File 5.44 KB 0644