[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.117.106.247: ~ $


#IGZ���
@s�ddlmZmZmZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZmZmZmZddlmZmZmZmZejZdZd	Zd
Zei�ZGdd�de�Ze�Zedd
d
dd
dddddd�
Z dd�Z!e!dddg�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'Gdd �d e�Z(dddd
d
dd
d!d!d!d!d"d�Z)e)Z*e
r�d#d$�Z+nd%d$�Z+d&d'�Z,d(d)�Z-d*d+�Z.d,d-�Z/d.d/�Z0dd0d1�Z1d2d3�Z2ddd4d5�Z3d6d7�Z4d8d9�Z5d:d;�Z6d<d=�Z7d>d?�Z8Gd@dA�dAe�Z9dBdC�e9j:D�Z;e.e1e3e9de;�de;�ddDdC�e;D��Z9GdEdF�dFe�Z<e1e3e<��Z<e)dGd
dHd!dId
�GdJdK�dKe��Z=efdLdM�Z>e)dGd
dId
�GdNdO�dOe��Z?dPdQ�Z@dS)R�)�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|S)Nr)r�_rrr�__deepcopy__#sz_Nothing.__deepcopy__cCs
|jtkS)N)�	__class__r)r�otherrrr�__eq__&sz_Nothing.__eq__cCs||kS)Nr)rrrrr�__ne__)sz_Nothing.__ne__cCsdS)N�NOTHINGr)rrrr�__repr__,sz_Nothing.__repr__cCsdS)Nl�>[=r)rrrr�__hash__/sz_Nothing.__hash__N)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrrrsrTc

Cs�|dk	r0|dk	r0|dk	r0td��|dk	rp|	dk	rTtd��tjdtdd�|}	|dkr�i}td	|d
|d|d|d
|d|d|	d|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.
    NTFz6Invalid value for hash.  Must be True, False, or None.zHCan't pass both `convert` and `converter`.  Please use `converter` only.z`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(r)r*�convertr,r-r+rrr�attrib9s.R$		
r5cCs�dj|�}dj|�dg}|rixIt|�D]+\}}|jtjd|d|��q7Wn
|jd�dti}ttdj|�d	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))
    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�ir7�globsrrr�_make_attr_tuple_class�s
	
"rE�_Attributes�attrs�super_attrscCst|�jd�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�srKcCs`t|dd�}|dkr"iSx7|jdd�D]"}|t|dd�kr6iSq6W|S)z$
    Get annotations for *cls*.
    �__annotations__Nr)�getattr�__mro__)�cls�anns�	super_clsrrr�_get_annotations�srRc	s5|j�t|��|dk	rOtdd�t|�D�ddd��}nG|dkrkdd	��j�D�}g}t�}x��j�D]�\}}t|�r�q�|j|��j|t	�}t
|t�s|t	kr�t�}ntd
|�}|j
||f�q�W||}	t|	�dkr�tdd
jt|	d�fdd���d��n+tdd��j�D�ddd��}�fdd�|D�}
g}dd�|
D�}x�|jdd�D]m}
t|
dd�}|dk	r�xF|D]>}|j|j�}|dkr|j
|�|||j<qWq�Wdd�||
D�}t|j|�}||�fdd�|D��}d}x�|D]{}|dkr�|jt	kr�|jdkr�tdjd|���q�|dkr�|jt	k	r�|jdk	r�d}q�Wt||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!|]\}}||fVqdS)Nr)�.0�name�carrr�	<genexpr>�sz#_transform_attrs.<locals>.<genexpr>�keycSs|djS)Nr)�counter)�errr�<lambda>�sz"_transform_attrs.<locals>.<lambda>TcSs+h|]!\}}t|t�r|�qSr)�
isinstancer3)rSrT�attrrrr�	<setcomp>�s		z#_transform_attrs.<locals>.<setcomp>r%rz1The following `attr.ib`s lack a type annotation: z, cs�j|�jS)N)�getrX)�n)�cdrrrZs�.css0|]&\}}t|t�r||fVqdS)N)r[r3)rSrTr\rrrrVs	cSs|djS)Nr)rX)rYrrrrZ sc
s=g|]3\}}tjd|d|d�j|���qS)rTrUr-)�	Attribute�from_counting_attrr^)rSr7rU)rPrr�
<listcomp>#s	z$_transform_attrs.<locals>.<listcomp>cSsi|]}||j�qSr)rT)rS�arrr�
<dictcomp>-s	z$_transform_attrs.<locals>.<dictcomp>r�__attrs_attrs__cSsg|]}|j�qSr)rT)rSrerrrrd;s	c
s=g|]3\}}tjd|d|d�j|���qS)rTrUr-)rbrcr^)rSr7rU)rPrrrdAs	FzqNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: {a!r}re���)�__dict__rR�sortedr
�items�setrK�addr^rr[r3r5r=�lenrrArNrMrTrErr%r*�
ValueErrorr;rF)rO�these�auto_attribsZca_listZca_namesZannot_namesr7r-reZunannotatedZ	own_attrsrHZtaken_attr_namesrQZ	sub_attrsZprev_arBZ
AttrsClassrGZhad_defaultr)rPr`r�_transform_attrs�sv				

5	



*	
rrcCs
t��dS)z4
    Attached to frozen classes as __setattr__.
    N)r)rrT�valuerrr�_frozen_setattrs[srtcCs
t��dS)z4
    Attached to frozen classes as __delattr__.
    N)r)rrTrrr�_frozen_delattrsbsruc@s�eZdZdZd#Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"S)$�
_ClassBuilderz(
    Iteratively build *one* class.
    �_cls�	_cls_dict�_attrs�_super_names�_attr_names�_slots�_frozen�_has_post_initcCs�t|||�\}}||_|r6t|j�ni|_||_tdd�|D��|_tdd�|D��|_	||_
|p�t|�|_t
t|dd��|_|j|jd<|r�t|jd<t|jd<dS)	Ncss|]}|jVqdS)N)rT)rSrerrrrVxsz)_ClassBuilder.__init__.<locals>.<genexpr>css|]}|jVqdS)N)rT)rSrerrrrVys�__attrs_post_init__Frg�__setattr__�__delattr__)rrrw�dictrirxryrlrz�tupler{r|�_has_frozen_superclassr}�boolrMr~rtru)rrOrp�slots�frozenrqrGrHrrr�__init__rs			
z_ClassBuilder.__init__cCsdjd|jj�S)Nz<_ClassBuilder(cls={cls})>rO)r;rwr)rrrrr�sz_ClassBuilder.__repr__cCs'|jdkr|j�S|j�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_class)rrrr�build_class�s
z_ClassBuilder.build_classcCs�|j}|j}xB|jD]7}||krt||d�dk	rt||�qWx-|jj�D]\}}t|||�qgW|S)zA
        Apply accumulated methods and return the class.
        N)rwrzr{rM�delattrrxrk�setattr)rrO�super_namesrTrsrrrr��s		z#_ClassBuilder._patch_original_classc	s��j��fdd�t�j�D�}t�fdd��jD��|d<t�jdd�}|dk	r|||d<t�j���fdd	�}�fd
d�}||d<||d
<t�j��jj�jj	|�}x�|j
j�D]~}t|t
tf�r-t|jdd�}nt|dd�}|sHq�x-|D]%}|j�jkrOt||�qOWq�W|S)zL
        Build and return a new class with a `__slots__` attribute.
        cs8i|].\}}|t�j�dkr||�qS)ri)ri)r�r{)rS�k�v)rrrrf�s		z5_ClassBuilder._create_slots_class.<locals>.<dictcomp>c3s!|]}|�kr|VqdS)Nr)rSrT)r�rrrV�sz4_ClassBuilder._create_slots_class.<locals>.<genexpr>�	__slots__r!Ncst�fdd��D��S)z9
            Automatically created by attrs.
            c3s|]}t�|�VqdS)N)rM)rSrT)rrrrV�szL_ClassBuilder._create_slots_class.<locals>.slots_getstate.<locals>.<genexpr>)r�)r)rB)rr�slots_getstate�sz9_ClassBuilder._create_slots_class.<locals>.slots_getstatecsCtj|t�}x*t�|�D]\}}|||�q"WdS)z9
            Automatically created by attrs.
            N)�_obj_setattr�__get__rb�zip)r�stateZ_ClassBuilder__bound_setattrrTrs)rBrr�slots_setstate�sz9_ClassBuilder._create_slots_class.<locals>.slots_setstate�__getstate__�__setstate__�__closure__)rzr
rxr�r{rMrwr-r�	__bases__ri�valuesr[�classmethod�staticmethod�__func__�
cell_contentsr)	rr`�qualnamer�r�rO�itemZ
closure_cellsZcellr)rBrr�rr��s8	
	

				
z!_ClassBuilder._create_slots_classcCs)|jt|jd|��|jd<|S)N�nsr)�_add_method_dunders�
_make_reprryrx)rr�rrr�add_repr�sz_ClassBuilder.add_reprcCsP|jjd�}|dkr*td��dd�}|j|�|jd<|S)Nrz3__str__ can only be generated if a __repr__ exists.cSs
|j�S)N)r)rrrr�__str__�sz&_ClassBuilder.add_str.<locals>.__str__r�)rxr^ror�)rr'r�rrr�add_str�s	z_ClassBuilder.add_strcCsd|jd<|S)Nr)rx)rrrr�make_unhashables
z_ClassBuilder.make_unhashablecCs#|jt|j��|jd<|S)Nr)r��
_make_hashryrx)rrrr�add_hashsz_ClassBuilder.add_hashcCs/|jt|j|j|j��|jd<|S)Nr�)r��
_make_initryr~r}rx)rrrr�add_initsz_ClassBuilder.add_initcsY�j}�fdd�t�j�D�\|d<|d<|d<|d<|d<|d<�S)	Nc3s|]}�j|�VqdS)N)r�)rS�meth)rrrrVsz(_ClassBuilder.add_cmp.<locals>.<genexpr>rr�__lt__�__le__�__gt__�__ge__)rx�	_make_cmpry)rr`r)rr�add_cmps	=z_ClassBuilder.add_cmpcCsfy|jj|_Wntk
r'YnXy%dj|jj|jf�|_Wntk
raYnX|S)zL
        Add __module__ and __qualname__ to a *method* if possible.
        ra)rwr �AttributeErrorrAr!r)r�methodrrrr�!s

z!_ClassBuilder._add_method_dundersN)rwrxryrzr{r|r}r~)rr r!r"r�r�rr�r�r�r�r�r�r�r�r�r�rrrrrvisH
rvFc
sK����������	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*
    csBt|dd�dkr$td��t|�	����}�dkrU|j���dkrk|j��dkr�|j��dk	r��dk	r��dk	r�td��nn�dks"�dkr��dkr�nG�dks�dkr�dkr�dkr|j�n
|j��dkr8|j�|j	�S)Nrz(attrs only works with new-style classes.TFz6Invalid value for hash.  Must be True, False, or None.)
rMr.rvr�r�r�r�r�r�r�)rOZbuilder)
rqr(r�r)r*r'�repr_nsr�rIrprr�wrap�s(


$$0


zattrs.<locals>.wrapNr)Z	maybe_clsrpr�r'r(r)r*r�r�rIrqr�r)
rqr(r�r)r*r'r�r�rIrprrG4sg- cCs1t|jdd�tjko0|jjtjkS)zb
        Check whether *cls* has a frozen ancestor by looking at its
        __setattr__.
        r N)rMr�rtr r)rOrrrr��sr�cCs
|jtkS)zb
        Check whether *cls* has a frozen ancestor by looking at its
        __setattr__.
        )r�rt)rOrrrr��scst�fdd�|D��S)z:
    Create a tuple of all values of *obj*'s *attrs*.
    c3s!|]}t�|j�VqdS)N)rMrT)rSre)�objrrrV�sz"_attrs_to_tuple.<locals>.<genexpr>)r�)r�rGr)r�r�_attrs_to_tuple�sr�c
Cstdd�|D��}tj�}|jt|�jd��d|j�f}t|�}ddd|fg}x"|D]}|jd|j	�q}W|jd	�d
j
|�}i}i}t||d�}	t|	||�t
|�d|jd�|ftj|<|d
S)NcssB|]8}|jdks6|jdkr|jdkr|VqdS)TN)r)r()rSrerrrrV�sz_make_hash.<locals>.<genexpr>zutf-8z<attrs generated hash %s>zdef __hash__(self):z    return hash((z        %d,z        self.%s,z    ))r8r:Tr)r��hashlib�sha1�updater'�encode�	hexdigestr)r=rTrAr@r?rn�
splitlines�	linecache�cache)
rGr��unique_filenameZ	type_hash�linesre�scriptrD�locs�bytecoderrrr��s.	


	r�cCst|�|_|S)z%
    Add a hash method to *cls*.
    )r�r)rOrGrrr�	_add_hashsr�cCs$|j|�}|tkrtS|S)z^
    Check equality and either forward a NotImplemented or return the result
    negated.
    )r�NotImplemented)rr�resultrrrrsrcs�dd��D��tj�}|jt��jd��d|j�f}dddg}�r�|jd�d	g}x<�D]4}|jd
|jf�|jd|jf�q�W||dg7}n
|jd
�dj|�}i}i}t	||d�}	t
|	||�t|�d|jd�|ft
j|<|d}
t}�fdd���fdd�}�fdd�}
�fdd�}�fdd�}|
|||
||fS)NcSsg|]}|jr|�qSr)r()rSrerrrrd!s	z_make_cmp.<locals>.<listcomp>zutf-8z<attrs generated eq %s>zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz
    return  (z
    ) == (z        self.%s,z        other.%s,z    )z    return Truer8r:Trcs
t|��S)z&
        Save us some typing.
        )r�)r�)rGrr�attrs_to_tupleLsz!_make_cmp.<locals>.attrs_to_tuplecs0t||j�r(�|��|�kStSdS)z1
        Automatically created by attrs.
        N)r[rr�)rr)r�rrr�Rsz_make_cmp.<locals>.__lt__cs0t||j�r(�|��|�kStSdS)z1
        Automatically created by attrs.
        N)r[rr�)rr)r�rrr�[sz_make_cmp.<locals>.__le__cs0t||j�r(�|��|�kStSdS)z1
        Automatically created by attrs.
        N)r[rr�)rr)r�rrr�dsz_make_cmp.<locals>.__gt__cs0t||j�r(�|��|�kStSdS)z1
        Automatically created by attrs.
        N)r[rr�)rr)r�rrr�msz_make_cmp.<locals>.__ge__)r�r�r�r'r�r�r=rTrAr@r?rnr�r�r�r)rGr�r�r�Zothersrer�rDr�r��eq�ner�r�r�r�r)rGr�rr� s@	
	

	
				r�cCsI|dkr|j}t|�\|_|_|_|_|_|_|S)z*
    Add comparison methods to *cls*.
    N)rgr�rrr�r�r�r�)rOrGrrr�_add_cmpys	0r�cs2tdd�|D�����fdd�}|S)zK
    Make a repr method for *attr_names* adding *ns* to the full name.
    css!|]}|jr|jVqdS)N)r'rT)rSrerrrrV�sz_make_repr.<locals>.<genexpr>cs��j}�dkrXt|dd�}|dk	rL|jdd�d
}qi|j}n�d|j}dj|dj�fdd	��D���S)z1
        Automatically created by attrs.
        Nr!z>.rraz{0}({1})z, c3s/|]%}|dtt�|t��VqdS)�=N)r'rMr)rSrT)rrrrV�sz/_make_repr.<locals>.__repr__.<locals>.<genexpr>rh)rrM�rsplitrr;rA)rZreal_clsr��
class_name)rBr�)rrr�s	z_make_repr.<locals>.__repr__)r�)rGr�rr)rBr�rr��s
	
r�cCs+|dkr|j}t||�|_|S)z%
    Add a repr method to *cls*.
    N)rgr�r)rOr�rGrrr�	_add_repr�s	r�c
Csdd�|D�}tj�}|jt|�jd��dj|j��}t|||�\}}i}t||d�}t	dd�|D��}	|jdt
d	|	i�|d
kr�t|d<t|||�t
|�d|jd
�|ftj|<|dS)
NcSs.g|]$}|js$|jtk	r|�qSr)r*r%r)rSrerrrrd�s	z_make_init.<locals>.<listcomp>zutf-8z<attrs generated init {0}>r:css|]}|j|fVqdS)N)rT)rSrerrrrV�sz_make_init.<locals>.<genexpr>r�	attr_dictTZ_cached_setattrr�)r�r�r�r'r�r;r��_attrs_to_init_scriptr@r�rr�r?rnr�r�r�)
rG�	post_initr�r�r�r�rDr�r�r�rrrr��s0	


	r�cCs(t|jt|dd�|�|_|S)zR
    Add a __init__ method to *cls*.  If *frozen* is True, make it immutable.
    rF)r�rgrMr�)rOr�rrr�	_add_init�s
r�cCsRt|�std��t|dd�}|dkrNtdjd|���|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.rgNz({cls!r} is not an attrs-decorated class.rO)r	r.rMrr;)rOrGrrr�fields�sr�cCsbtjdkrdSxHt|j�D]7}|j}|dk	r#|||t||j��q#WdS)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&rMrT)�instrer�rrr�validates	r�cCs�g}|dkr:|jd�dd�}dd�}ndd�}dd�}g}g}i}x�|D]�}	|	jr�|j|	�|	j}
|	jjd	�}t|	jt�}|r�|	jjr�d
}
nd}
|	jdkr�|r�t	j
|	j�}|	jd
k	rP|j||
|dj
|
���tj
|	j�}|	j||<n#|j||
|dj
|
���|	jj
||<q|	jd
k	r�|j||
dj
d|
���tj
|	j�}|	j||<q|j||
dj
d|
���qk|	jtk	r�|r�|jdj
d|d|
��|	jd
k	rt|j||
|��|	j|tj
|	j�<q|j||
|��qk|r�|jdj
d|��|jdj
d|��t	j
|	j�}|	jd
k	rP|jd||
|��|jd�|jd||
|dj
|
���|	j|tj
|	j�<nN|jd||
|��|jd�|jd||
|dj
|
���|	jj
||<qk|j|�|	jd
k	r�|j||
|��|	j|tj
|	j�<qk|j||
|��qkW|r�t|d<|jd�xh|D]`}	dj
|	j�}dj
|	j�}
|jdj
||
|	j��|	j||<|	||
<q=W|r�|jd�dj
ddj|�d |r�d!j|�nd"�|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__)cSsdd|d|iS)Nz(_setattr('%(attr_name)s', %(value_var)s)r7�	value_varr)r7r�rrr�
fmt_setter)sz)_attrs_to_init_script.<locals>.fmt_settercSs)tj|�}dd|d|d|iS)Nz2_setattr('%(attr_name)s', %(conv)s(%(value_var)s))r7r��conv)�_init_converter_patr;)r7r��	conv_namerrr�fmt_setter_with_converter/s
z8_attrs_to_init_script.<locals>.fmt_setter_with_convertercSsdd|d|iS)Nzself.%(attr_name)s = %(value)sr7rsr)r7rsrrrr�7scSs)tj|�}dd|d|d|iS)Nz,self.%(attr_name)s = %(conv)s(%(value_var)s)r7r�r�)r�r;)r7r�r�rrrr�=s
rrr9FNz({0})z attr_dict['{attr_name}'].defaultr7z+{arg_name}=attr_dict['{attr_name}'].default�arg_namez{arg_name}=NOTHINGzif {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}
�argsz, r�z
    �pass)r=r&rT�lstripr[r%�Factory�
takes_selfr*�_init_factory_patr;r+r��factoryrrrA)rGr�r�r�r�r�r�Zattrs_to_validateZnames_for_globalsrer7r�Zhas_factoryZ
maybe_selfZinit_factory_namer�Zval_namerrrr�s�	
	
						
			









	r�c
@seZdZdZdZddddd
d�Zdd�Zedd��Ze	ddd��Z
dd�Zdd�ZdS)rbz�
    *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`.
    rTr%r&r'r(r)r*r,r-r+Nc
Cs�tj|t�}|dk	rR|dk	r6td��tjdtdd�|}|d|�|d|�|d|�|d|�|d	|�|d
|�|d|�|d|�|d
|	r�t|	�nt�|d|
�dS)NzHCan't pass both `convert` and `converter`.  Please use `converter` only.z`The `convert` argument is deprecated in favor of `converter`.  It will be removed after 2019/01.r#r$rTr%r&r'r(r)r*r+r,r-)	r�r�rbr/r0r1r2r�_empty_metadata_singleton)
rrTr%r&r'r(r)r*r4r,r-r+�
bound_setattrrrrr��s*	








zAttribute.__init__cCs
t��dS)N)r)rrTrsrrrr��szAttribute.__setattr__cCstjdtdd�|jS)NzaThe `convert` attribute is deprecated in favor of `converter`.  It will be removed after 2019/01.r#r$)r0r1r2r+)rrrrr4�s
zAttribute.convertc
sw|dkr�j}n�jdk	r3td���fdd�tjD�}|d|d�jd�jd||�S)Nz8Type annotation and type argument cannot both be presentcs.i|]$}|dkrt�|�|�qS)rTr&r%r-r4)rTr&r%r-r4)rM)rSr�)rUrrrfs	z0Attribute.from_counting_attr.<locals>.<dictcomp>rTr&r%r-)r-rorbr��
_validator�_default)rOrTrUr-�	inst_dictr)rUrrc�s	
zAttribute.from_counting_attrcs t�fdd��jD��S)z(
        Play nice with pickle.
        c3s9|]/}|dkr$t�|�nt�j�VqdS)r,N)rMr�r,)rSrT)rrrrVsz)Attribute.__getstate__.<locals>.<genexpr>)r�r�)rr)rrr�szAttribute.__getstate__cCsttj|t�}x[t|j|�D]G\}}|dkrM|||�q%|||ret|�nt�q%WdS)z(
        Play nice with pickle.
        r,N)r�r�rbr�r�rr�)rr�r�rTrsrrrr�szAttribute.__setstate__)
rTr%r&r'r(r)r*r,r-r+)
rr r!r"r�r�r��propertyr4r�rcr�r�rrrrrb�s	!	rbcCsUg|]K}|dkrtd|dtddddddd|d	kd
d��qS)r4rTr%r&Nr'Tr(r)r,r*)rbr)rSrTrrrrd%s	rdcCsg|]}|jr|�qSr)r))rSrerrrrd-s	c@s�eZdZdZdZedd
�dD��edddddddddddddd�fZdZdd�Z	dd�Z
dd�ZdS)r3a
    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+r-ccsB|]8}td|dtdddddddddd�VqdS)	rTr%r&Nr'Tr(r)r*)rbr)rSrTrrrrV<sz_CountingAttr.<genexpr>rTr%Nr&TFrc

Cs�tjd7_tj|_||_|rQt|ttf�rQt|�|_n	||_||_	||_
||_||_||_
||_|	|_dS)Nr)r3�cls_counterrXr�r[�listr��and_r�r'r(r)r*r+r,r-)
rr%r&r'r(r)r*r+r,r-rrrr�Fs								z_CountingAttr.__init__cCs4|jdkr||_nt|j|�|_|S)z�
        Decorator that adds *meth* to the list of validators.

        Returns *meth* unchanged.

        .. versionadded:: 17.1.0
        N)r�r�)rr�rrrr&Xsz_CountingAttr.validatorcCs1|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
        r�T)r�rr
r�)rr�rrrr%fs
	z_CountingAttr.default)
rXr�r'r(r)r*r,r�r+r-)rXr�r'r(r)r*)rr r!r"r�r�rbrgr�r�r&r%rrrrr31s	
r3r�r*r)c@s7eZdZdZe�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��s	zFactory.__init__N)rr r!r"r5r�r�r�rrrrr�{s		r�cKs�t|t�r|}n=t|ttf�rItdd�|D��}ntd��|jdd�}t|||dkr�in	d|i�}y%tjd�j	j
dd�|_Wntt
fk
r�YnXtd	||�|�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�fVqdS)N)r5)rSrerrrrV�szmake_class.<locals>.<genexpr>z(attrs argument must be a dict or a list.rNrr�__main__rp)r[r�r�r�r.�popr-�sys�	_getframe�	f_globalsr^r r�rory)rTrG�basesZattributes_argumentsZcls_dictr�Ztype_rrr�
make_class�s 	!r�c@s+eZdZdZe�Zdd�ZdS)�
_AndValidatorz2
    Compose many validators to a single one.
    cCs(x!|jD]}||||�q
WdS)N)�_validators)rr�r\rsr�rrr�__call__�sz_AndValidator.__call__N)rr r!r"r5r�r�rrrrr��s	r�cGsOg}x6|D].}|jt|t�r1|jn|g�q
Wtt|��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
    )�extendr[r�r�r�)Z
validators�valsr&rrrr��s
r�)AZ
__future__rrrr�r�r�r0�operatorrr9rZ_compatrr	r
rr�
exceptionsr
rrr�objectr�r�r�r�r>r�rrr5rErFrKrRrrrtrurvrGryr�r�r�r�rr�r�r�r�r�r�r�r�r�rbr�Z_ar3r�r�r�r�rrrr�<module>s|("		r
p�	�(Y
",�j	
G%3

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 1.37 KB 0644
__init__.cpython-35.pyc File 1.37 KB 0644
_compat.cpython-35.opt-1.pyc File 4.38 KB 0644
_compat.cpython-35.pyc File 4.38 KB 0644
_config.cpython-35.opt-1.pyc File 693 B 0644
_config.cpython-35.pyc File 693 B 0644
_funcs.cpython-35.opt-1.pyc File 7.05 KB 0644
_funcs.cpython-35.pyc File 7.05 KB 0644
_make.cpython-35.opt-1.pyc File 43.37 KB 0644
_make.cpython-35.pyc File 43.37 KB 0644
converters.cpython-35.opt-1.pyc File 791 B 0644
converters.cpython-35.pyc File 791 B 0644
exceptions.cpython-35.opt-1.pyc File 1.83 KB 0644
exceptions.cpython-35.pyc File 1.83 KB 0644
filters.cpython-35.opt-1.pyc File 1.79 KB 0644
filters.cpython-35.pyc File 1.79 KB 0644
validators.cpython-35.opt-1.pyc File 5.75 KB 0644
validators.cpython-35.pyc File 5.75 KB 0644