
    6h!}                    p   S SK r S SKrS SKrS SKrS SKrS SKJr  SSKJrJ	r	J
r
  SSKJrJrJrJrJrJr  SSKJrJrJrJr  \R.                  rSrSrS	rS
rSr\R<                  " 0 5      r\" 5       r \
RB                  " \
RD                  \
RF                  5      r$ " S S5      r%\%" 5       r&  " S S\'5      r(\&SSSSSSSSSSSSS4S jr)SNS jr*S r+S r,\," S/ SQ5      r-S r.S r/S r0S r1S r2S r3S r4\(       a  S r5OS  r5S! r6 " S" S#5      r7S$ r8S% r9 SOS& jr:                       SPS' jr;\;r< S( r=S) r>S* r?S+ r@S, rAS- rBS. rCSQS/ jrD\(       a  S0 rEOS1 rESRS2 jrFS3 rGS4 rHS5 r#S6 rIS7 rJS8 rKS9 rLS: rMS; rNS< rOS= rP " S> S?5      rQ\QR                   V s/ s H  n \Q" U \&SSSSSU S@:g  SSSA9
PM     sn rS\@" \D" \F" \Q\SSB9\S Vs/ s H  oR                  SC:w  d  M  UPM     snSB9\S Vs/ s H)  oR                  (       d  M  UR                  SC:w  d  M'  UPM+     snSB9rQ " SD SE5      rV\D" \F" \V5      5      rV " SF SG5      rW\WR                   V s/ s H  n \Q" U \&SSSSSSSSSA9
PM     sn rX\@" \D" \F" \W\XSB9\XSB9\XSB9rW\44SH jrY\;" SSSI9 " SJ SK5      5       rZSL r[SM r!gs  sn f s  snf s  snf s  sn f )S    N)
itemgetter   )_compat_configsetters)HAS_F_STRINGSPY310PYPY_AnnotationExtractorordered_dictset_closure_cell)DefaultAlreadySetErrorFrozenInstanceErrorNotAnAttrsClassErrorUnannotatedAttributeErrorz__attr_converter_%sz__attr_factory_{}z=    {attr_name} = _attrs_property(_attrs_itemgetter({index})))ztyping.ClassVarz
t.ClassVarClassVarztyping_extensions.ClassVar_attrs_cached_hashc                   <   ^  \ rS rSrSrSrU 4S jrS rS rSr	U =r
$ )_Nothing8   z
Sentinel class to indicate the lack of a value when ``None`` is ambiguous.

``_Nothing`` is a singleton. There is only ever one of it.

.. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
Nc                 v   > [         R                  c  [        TU ]  U 5      [         l        [         R                  $ N)r   
_singletonsuper__new__)cls	__class__s    A/usr/lib/python3/dist-packages/mercurial/thirdparty/attr/_make.pyr   _Nothing.__new__C   s,    &"''/#"6H"""    c                     g)NNOTHING selfs    r   __repr___Nothing.__repr__H   s    r    c                     g)NFr#   r$   s    r   __bool___Nothing.__bool__K   s    r    r#   )__name__
__module____qualname____firstlineno____doc__r   r   r&   r)   __static_attributes____classcell__)r   s   @r   r   r   8   s#     J#
 r    r   c                   2    \ rS rSrSr\" S5      S4S jrSrg)_CacheHashWrapperU   ae  
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.
Nr#   c                     X4$ r   r#   )r%   _none_constructor_argss      r   
__reduce___CacheHashWrapper.__reduce__a   s     ''r    )r+   r,   r-   r.   r/   typer8   r0   r#   r    r   r3   r3   U   s    	 ,0:R (r    r3   TFc                    [        X;US5      u  ppUb  USLa  USLa  [        S5      eU	b:  U [        La  [        S5      e[	        U	5      (       d  [        S5      e[        U	5      n Uc  0 n[        U[        [        45      (       a  [        R                  " U6 nU(       a#  [        U[        [        45      (       a  [        U6 nU(       a#  [        U[        [        45      (       a  [        U6 n[        U UUSUUUUUU
UUUUUS9$ )a  
Create a new attribute on a class.

..  warning::

    Does *not* do anything unless the class is also decorated with
    `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 `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
    `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 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.  In Python 3.6 or greater, 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 (Python 3+)
    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`

.. 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
TNF6Invalid 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)_determine_attrib_eq_order	TypeErrorr"   
ValueErrorcallableFactory
isinstancelisttupler   pipeand__CountingAttr)r=   r>   r?   r@   rA   rB   rD   r:   rC   factoryrE   rF   rH   rJ   rG   rI   s                   r   attribrW   e   s&   b $>$ B D,U1BD
 	
 '!    IJJ'" *tUm,,\\:.
Z	D%=99)$	Z	D%=99)$	 r    c                 4    [        XS5      n[        XAU5        g)zM
"Exec" the script with the given global (globs) and local (locs) variables.
execN)compileeval)scriptglobslocsfilenamebytecodes        r   _compile_and_evalra   )  s     v0H$r    c                     0 nSnUn [        U5      SUR                  S5      U4n[        R                  R	                  X'5      nX:X  a  OSR                  USS U5      nUS-  nM_  [        XXB5        X@   $ )zG
Create the method with the script given and return the method object.
r   TNz{}-{}>)len
splitlines	linecachecache
setdefaultformatra   )	namer\   r_   r]   r^   countbase_filenamelinecache_tupleold_vals	            r   _make_methodro   1  s     D EM
Kd#	
 //,,XG%}Sb'95AHQJE  fT4:r    c                 @   SR                  U 5      nSR                  U5      S/nU(       a7  [        U5       H'  u  pEUR                  [        R                  XES95        M)     OUR                  S5        [        [
        S.n[        SR                  U5      U5        Xb   $ )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{}Attributeszclass {}(tuple):z    __slots__ = ())index	attr_namez    pass)_attrs_itemgetter_attrs_property
)ri   	enumerateappend_tuple_property_patr   propertyra   join)cls_name
attr_namesattr_class_nameattr_class_templateirr   r]   s          r   _make_attr_tuple_classr   N  s     %++H5O!!/2 %j1LA&&#***H 2
 	"":.",JEdii 34e<!!r    _Attributes)attrs
base_attrsbase_attrs_mapc                     [        U 5      n U R                  S5      (       a  U R                  S5      (       a  U SS n U R                  [        5      $ )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.
)'"r   rc   )str
startswithendswith_classvar_prefixes)annots    r   _is_class_varr   x  sK     JE 
##z(B(Ba.//r    c                     [        X[        5      nU[        L a  gU R                  SS  H  n[        X1S5      nX$L d  M    g   g)z^
Check whether *cls* defines *attrib_name* (and doesn't just inherit it).

Requires Python 3.
Fr   NT)getattr	_sentinel__mro__)r   attrib_nameattrbase_clsas        r   _has_own_attributer     sH     3Y/DyKKOH409 $
 r    c                 @    [        U S5      (       a  U R                  $ 0 $ )z
Get annotations for *cls*.
__annotations__)r   r   r   s    r   _get_annotationsr     s#     #011"""Ir    c                      U S   R                   $ )zI
Key function for sorting to avoid re-creating a lambda for every class.
r   counteres    r   _counter_getterr     s     Q4<<r    c                    / n0 n[        U R                  SS 5       Hh  n[        US/ 5       HT  nUR                  (       d  UR                  U;   a  M&  UR                  SS9nUR                  U5        XCUR                  '   MV     Mj     / n[        5       n[        U5       HB  nUR                  U;   a  M  UR                  SU5        UR                  UR                  5        MD     Xc4$ )zI
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
r   rc   __attrs_attrs__T	inheritedr   )
reversedr   r   r   rj   evolverw   setinsertadd)r   taken_attr_namesr   base_attr_mapr   r   filteredseens           r   _collect_base_attrsr     s     JM S[[2./#4b9A{{aff(884(Aa $,!&&! : 0 H5Dj!66T>1	 " ""r    c                    / n0 nU R                   SS  Hr  n[        US/ 5       H^  nUR                  U;   a  M  UR                  SS9nUR	                  UR                  5        UR                  U5        XCUR                  '   M`     Mt     X#4$ )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.
r   rc   r   Tr   )r   r   rj   r   r   rw   )r   r   r   r   r   r   s         r   _collect_base_attrs_brokenr     s     JM KK"%#4b9Avv))4(A  (a $,!&&! : & $$r    c                   ^ U R                   m[        U 5      nUbO  UR                  5        VVs/ s H  u  pxXx4PM
     n	nn[        U[        5      (       d  U	R                  [        S9  GOCUSL Ga  TR                  5        VV
s1 s H  u  pz[        U
[        5      (       d  M  UiM      nnn
/ n	[        5       nUR                  5        H  u  p[        U5      (       a  M  UR                  U5        TR                  U[        5      n[        U[        5      (       d  U[        L a  [        5       nO	[        US9nU	R                  X45        M     X-
  n[        U5      S:  a,  [!        SSR#                  [%        UU4S jS95      -   S-   5      eO [%        S	 TR                  5        5       S
 S9n	U	 VVs/ s H(  u  p[&        R)                  XUR                  U5      S9PM*     nnnU(       a*  [+        U U Vs1 s H  oR,                  iM     sn5      u  nnO)[/        U U Vs1 s H  oR,                  iM     sn5      u  nnU(       a<  U Vs/ s H  oR1                  SS9PM     nnU Vs/ s H  oR1                  SS9PM     nnUU-   nSnS U 5        HH  nUSL a"  UR2                  [        L a  [5        SU< 35      eUSL d  M1  UR2                  [        Ld  MF  SnMJ     Ub	  U" U U5      nU Vs/ s H  oR,                  PM     nn[7        U R8                  U5      n[;        U" U5      UU45      $ s  snnf s  sn
nf s  snnf s  snf s  snf s  snf s  snf s  snf )a  
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`.
)keyTr=   r   z1The following `attr.ib`s lack a type annotation: , c                 :   > TR                  U 5      R                  $ r   )getr   )ncds    r   <lambda>"_transform_attrs.<locals>.<lambda>  s    bffQi6G6Gr    .c              3   Z   #    U  H!  u  p[        U[        5      (       d  M  X4v   M#     g 7fr   )rP   rU   ).0rj   r   s      r   	<genexpr>#_transform_attrs.<locals>.<genexpr>  s'      ",JDdM2 ",s   +
+c                      U S   R                   $ Nr   r   r   s    r   r   r   !  s    !A$,,r    )rj   car:   )rE   Fc              3   h   #    U  H(  oR                   S Ld  M  UR                  S L d  M$  Uv   M*     g7f)FN)rB   rE   r   r   s     r   r   r   ?  s(     MA&&"5a!))u:Laas   22	2zlNo mandatory attributes allowed after an attribute with a default value or factory.  Attribute in question: )__dict__r   itemsrP   r   sortr   rU   r   r   r   r   r"   rW   rw   rd   r   rz   sorted	Attributefrom_counting_attrr   rj   r   r   r=   rM   r   r+   r   )r   theseauto_attribsrE   collect_by_mrofield_transformerannsrj   r   ca_listr   ca_namesannot_namesrr   r:   r   unannotated	own_attrsr   r   r   had_defaultr|   
AttrsClassr   s                           @r   _transform_attrsr     s=    
BC D.3kkm<m($D:m<%..LL_L-		 !hhj
(
$. ( 	 

 e#zz|OIT""OOI&y'*Aa//<Aq)ANNI>*  , ,{a+C));,GH 	    "$((*
 '
 %	 %MI 	$$(; 	% 	
 %	   $7),)Q&&),%
!
M %?),)Q&&),%
!
M 5>?YXXdX+Y	?6@Ajhhth,j
A"E KMM$199#7JKN 
 %AIIW$<K N $!#u- #((%Q&&%J('jAJ
5):}EFFs =

N - - @A0 )s5   L/L5#L53/L;6M
 M

M(M.Mc                 z    [        U [        5      (       a  US;   a  [        R                  XU5        g[        5       e),
Attached to frozen classes as __setattr__.
)	__cause____context__N)rP   BaseException__setattr__r   r%   rj   values      r   _frozen_setattrsr   V  s;     dM**t 8
 0
 %%d%8!##r    c                     [        5       e)r   r   r   s      r   r   r   e  s     "##r    c                     [        5       e)z,
Attached to frozen classes as __delattr__.
r   )r%   rj   s     r   _frozen_delattrsr   l  s     
r    c                       \ rS rSrSrSrS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rSrg)_ClassBuilderis  z 
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                    [        UUUUUU5      u  nnnXl        U(       a  [        UR                  5      O0 U l        Xl        U Vs1 s H  nUR                  iM     snU l        UU l        [        S U 5       5      U l
        X0l        X@l        XPl        Xl        [        [!        USS5      5      U l        [        [!        USS5      5      U l        [        U5      (       + U l        Xl        Xl        Xl        SU l        U R
                  U R                  S'   U(       a.  [0        U R                  S'   [2        U R                  S'   SU l        OU[4        [6        R8                  [6        R:                  4;   a  S=nnU H3  nUR<                  b  SnUR>                  b  SnU(       d  M*  U(       d  M3    O   U[4        :X  a  U(       d  U(       a6  U[6        R8                  :X  a  U(       a  U[6        R:                  :X  a  U(       d  S U l        U(       a.  U RA                  5       u  U R                  S	'   U R                  S
'   g g s  snf )Nc              3   8   #    U  H  oR                   v   M     g 7fr   rj   r   s     r   r   )_ClassBuilder.__init__.<locals>.<genexpr>  s      7As   __attrs_pre_init__F__attrs_post_init__r   r   __delattr__T__getstate____setstate__)!r   r   dictr   r   r   rj   r   r   rR   r   r   r   r   r   boolr   r   r   r   r   r   r   r   r   r   _ng_default_on_setattrr   validateconvertr>   rC   _make_getstate_setstate)r%   r   r   slotsfrozenweakref_slotgetstate_setstater   rE   
cache_hashis_excr   rJ   has_custom_setattrr   r   r   base_mapr   has_validatorhas_converters                        r   __init___ClassBuilder.__init__  s   " '7'
#z8 	/4cll+",67JqAFFJ7&  7 77)%!'#/CU"KL"730Eu#MN#';%#5 "',0KK(),<DNN=),<DNN=)&*D#"OO
 

 -21MM;;*$(M;;*$(M =]]  "88*m'"2"22='//1-
 $(  ,,.~.~. e 8s   H?c                 H    SR                  U R                  R                  S9$ )Nz<_ClassBuilder(cls={cls})>r   )ri   r   r+   r$   s    r   r&   _ClassBuilder.__repr__  s     +22tyy7I7I2JJr    c                 `    U R                   SL a  U R                  5       $ U R                  5       $ )zk
Finalize class based on the accumulated configuration.

Builder cannot be used after calling this method.
T)r   _create_slots_class_patch_original_classr$   s    r   build_class_ClassBuilder.build_class  s.     ;;$++----//r    c                    U R                   nU R                  nU R                  (       a?  U R                   H/  nX2;  d  M
  [	        X[
        5      [
        Ld  M#   [        X5        M1     U R                  R                  5        H  u  p4[        XU5        M     U R                  (       d5  [	        USS5      (       a#  SUl        U R                  (       d  [        Ul        U$ ! [         a     M  f = f)z1
Apply accumulated methods and return the class.
__attrs_own_setattr__F)r   r   r   r   r   r   delattrAttributeErrorr   r   setattrr   r  r   _obj_setattrr   )r%   r   
base_namesrj   r   s        r   r  #_ClassBuilder._patch_original_class  s     ii%%
 ((*95YF* )  >>//1KDCu% 2
 &&7(%,
 ,
 ).C%++".
) *  	s   C  
C.-C.c                 4   U R                   R                  5        VVs0 s H%  u  pU[        U R                  5      S-   ;  d  M#  X_M'     nnnU R                  (       d_  SUS'   U R
                  (       dI  U R                  R                   H/  nUR                  R                  SS5      (       d  M&  [        US'     O   [        5       nSnU R                  R                  SS  HY  nUR                  R                  SS5      b  S	nUR                  [        US
/ 5       Vs0 s H  nU[        XG5      _M     sn5        M[     [        U R                   5      nU R                  n	U R"                  (       a-  S[        U R                  S
S5      ;  a  SU	;  a  U(       d  U	S-  n	U	 Vs/ s H  owU;  d  M
  UPM     n
nUR                  5        VVs0 s H  u  pX;   d  M  X_M     nnnU
 Vs/ s H  owU;  d  M
  UPM     n
nUR                  U5        U R$                  (       a  U
R'                  [(        5        [        U
5      US
'   U R                  R*                  US'   [-        U R                  5      " U R                  R.                  U R                  R                  U5      nUR                  R1                  5        H  n[3        U[4        [6        45      (       a  [        UR8                  SS5      nO:[3        U[:        5      (       a  [        UR<                  SS5      nO[        USS5      nU(       d  My  U H1  n UR>                  U R                  L nU(       a  [A        UU5        M1  M3     M     U$ s  snnf s  snf s  snf s  snnf s  snf ! [B         a     Mc  f = f)z<
Build and return a new class with a `__slots__` attribute.
)r   __weakref__Fr  r   r   rc   r#  NT	__slots__r#   )r#  r-   __closure__)"r   r   rR   r   r   r   r   	__bases__r   r   r  r  r   updater   r   r   r   r   rw   _hash_cache_fieldr-   r:   r+   valuesrP   classmethodstaticmethod__func__ry   fgetcell_contentsr   rM   )r%   kvr   r   existing_slotsweakref_inheritedrj   r   names
slot_namesslotslot_descriptorreused_slotsr   itemclosure_cellscellmatchs                      r   r  !_ClassBuilder._create_slots_class  sF    ,,.
.d../2MMM AD. 	 
 &&*/B&'++ $		 3 3H((,,-DeLL,8=) !4 !		))!B/H  $$]D9E$(!!! !(+r B B '(11 B 0 ))*
  WTYYR%HHU*%%%E (-GutJ0Fdu
G *8)=)=)?
)?%! "D!)? 	 

 (2Nzt5Mdz
N
		,/0
+;!YY33> 499odii00$))2E2ErJ LL'')D$l ;<< !(}d KD(++ !(		=$ G 'mT B %4 ..$));E (s3  & *. 
I
>& H


 OD " sG   "M.M.M4
"	M9/M9
M>M>&	N3N7N		
NNc                 ~    U R                  [        U R                  XR                  5      5      U R                  S'   U $ )Nr&   )_add_method_dunders
_make_reprr   r   r   )r%   nss     r   add_repr_ClassBuilder.add_repr  s4    %)%=%=t{{B		2&
z" r    c                     U R                   R                  S5      nUc  [        S5      eS nU R                  U5      U R                   S'   U $ )Nr&   z3__str__ can only be generated if a __repr__ exists.c                 "    U R                  5       $ r   r&   r$   s    r   __str__&_ClassBuilder.add_str.<locals>.__str__  s    ==?"r    rF  )r   r   rM   r>  )r%   r?   rF  s      r   add_str_ClassBuilder.add_str  sP    ~~!!*-<E 	# %)$<$<W$Ey!r    c                 v   ^^ [        S U R                   5       5      mU4S jnU R                  mUU4S jnX4$ )z6
Create custom __setstate__ and __getstate__ methods.
c              3   4   #    U  H  oS :w  d  M
  Uv   M     g7f)r#  Nr#   )r   ans     r   r   8_ClassBuilder._make_getstate_setstate.<locals>.<genexpr>  s      !
)2=-@BB)s   		c                 0   >^  [        U 4S jT 5       5      $ )!
Automatically created by attrs.
c              3   <   >#    U  H  n[        TU5      v   M     g 7fr   r   r   rj   r%   s     r   r   P_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate.<locals>.<genexpr>  s     J9It,,9I   rR   )r%   state_attr_namess   `r   slots_getstate=_ClassBuilder._make_getstate_setstate.<locals>.slots_getstate  s     J9IJJJr    c                    > [         R                  U [        5      n[        TU5       H  u  p4U" X45        M     T(       a  U" [        S5        gg)rO  N)r  __get__r   zipr(  )r%   state_ClassBuilder__bound_setattrrj   r   hash_caching_enabledrV  s        r   slots_setstate=_ClassBuilder._make_getstate_setstate.<locals>.slots_setstate  sH     +224CO"#3U;,  < $ 148 $r    )rR   r   r   )r%   rW  r_  r^  rV  s      @@r   r  %_ClassBuilder._make_getstate_setstate  sG    
 ! !
))!
 
	K  $//	9 --r    c                 $    S U R                   S'   U $ )N__hash__)r   r$   s    r   make_unhashable_ClassBuilder.make_unhashable  s    %)z"r    c           	          U R                  [        U R                  U R                  U R                  U R
                  S95      U R                  S'   U $ )Nr  r  rc  )r>  
_make_hashr   r   r   r   r   r$   s    r   add_hash_ClassBuilder.add_hash  sH    %)%=%=		||++	&
z" r    c                 ,   U R                  [        U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  U R                  SS95      U R                  S'   U $ )NF
attrs_initr  r>  
_make_initr   r   r   r   r   r   r   r   r   r   r   r$   s    r   add_init_ClassBuilder.add_init  s}    %)%=%=		""##  ##   &
z"  r    c                 V    [        S U R                   5       5      U R                  S'   g )Nc              3      #    U  H7  nUR                   (       d  M  UR                  (       a  M)  UR                  v   M9     g 7fr   )rB   rE   rj   )r   fields     r   r   /_ClassBuilder.add_match_args.<locals>.<genexpr>  s0      1
$zz "'-- EJJ$s   AAA__match_args__)rR   r   r   r$   s    r   add_match_args_ClassBuilder.add_match_args  s'    +0 1
1
 ,
'(r    c                 ,   U R                  [        U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  U R                  SS95      U R                  S'   U $ )NTrl  __attrs_init__rn  r$   s    r   add_attrs_init_ClassBuilder.add_attrs_init  s~    +/+C+C		""##  ##  ,
'(  r    c                     U R                   nU R                  [        U R                  U R                  5      5      US'   U R                  [        5       5      US'   U $ )N__eq____ne__)r   r>  _make_eqr   r   _make_ner%   r   s     r   add_eq_ClassBuilder.add_eq  sN    ^^//TYY,
8 //
;8r    c                    ^  T R                   nU 4S j[        T R                  T R                  5       5       u  US'   US'   US'   US'   T $ )Nc              3   F   >#    U  H  nTR                  U5      v   M     g 7fr   )r>  )r   methr%   s     r   r   *_ClassBuilder.add_order.<locals>.<genexpr>  s'      B
; $$T**;s   !__lt____le____gt____ge__)r   _make_orderr   r   r  s   ` r   	add_order_ClassBuilder.add_order  sL    ^^B
#DIIt{{;B
>8blBxL"X,
 r    c                   ^ U R                   (       a  U $ 0 mU R                   HP  nUR                  =(       d    U R                  nU(       d  M+  U[        R
                  Ld  M@  X4TUR                  '   MR     T(       d  U $ U R                  (       a  [        S5      eU4S jnSU R                  S'   U R                  U5      U R                  S'   SU l        U $ )Nz7Can't combine custom __setattr__ with on_setattr hooks.c                 d   >  TU   u  p4U" XU5      n[        XU5        g ! [          a    Un Nf = fr   )KeyErrorr  )r%   rj   valr   hooknvalsa_attrss         r   r   ._ClassBuilder.add_setattr.<locals>.__setattr__  sA    *"4. DS)T*  s     //Tr  r   )r   r   rJ   r   r   NO_OPrj   r   rM   r   r>  r   )r%   r   rJ   r   r  s       @r   add_setattr_ClassBuilder.add_setattr  s    <<KA9)9)9Jzj=#$=  
 K##I 
	+ 37./(,(@(@(M}%"&r    c                 N    U R                   R                  Ul         SR                  U R                   R                  UR
                  45      Ul        SU R                   R                  < S3Ul        U$ ! [         a     Nef = f! [         a     N>f = f! [         a     U$ f = f)z<
Add __module__ and __qualname__ to a *method* if possible.
r   z$Method generated by attrs for class )r   r,   r  rz   r-   r+   r/   )r%   methods     r   r>  !_ClassBuilder._add_method_dunders)  s    	 $		 4 4F	"%((''9#F			&&FN #  		  		  		s4   A6 6B  B 6
BB
BB
B$#B$)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   N)r+   r,   r-   r.   r/   r$  r  r&   r  r  r  rA  rH  r  rd  ri  rp  rw  r{  r  r  r  r>  r0   r#   r    r   r   r   s  sk    I(S/jK	0$LhT .D
&
&"Hr    r   c                     U b!  [        USLUSL45      (       a  [        S5      eU b  X 4$ Uc  UnUc  UnUSL a  USL a  [        S5      eX4$ )
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.anyrM   )r@   rF   rH   
default_eqs       r   _determine_attrs_eq_orderr  C  sr    
 3$T0ABCCABB x 
z}	U{u}HII9r    c                     U b!  [        USLUSL45      (       a  [        S5      eS nU b  U" U 5      u  pXX4$ Uc  USpaO
U" U5      u  pUc  XprO
U" U5      u  p'USL a  USL a  [        S5      eXX'4$ )r  Nr  c                 8    [        U 5      (       a  SU pX4$ SnX4$ )z(
Decide whether a key function is used.
TN)rN   )r   r   s     r   decide_callable_or_boolean>_determine_attrib_eq_order.<locals>.decide_callable_or_booleane  s-     E??u3 z Czr    FTr  r  )r@   rF   rH   r  r  cmp_keyrG   rI   s           r   rK   rK   ]  s    
 3$T0ABCCABB 1#6S)) 
zF/3
}y5e<	U{u}HIIu''r    c                 h    USL d  USL a  U$ Uc  USL a  U$ U H  n[        X5      (       d  M    g   U$ )aX  
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    sH     t|tu}|u, c**  Nr    c                    ^^^^^^^	^
^^^^^^^^^^^^^ [        XOUS5      u  mmUm[        T[        [        45      (       a  [        R
                  " T6 mUUUUUUUUUUUUUUUUUUU
UU	4S jnU c  U$ U" U 5      $ )a1  
A class decorator that adds `dunder
<https://wiki.python.org/moin/DunderAlias>`_\ -methods according to the
specified attributes using `attr.ib` or the *these* argument.

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

    If *these* is an ordered dict (`dict` on Python 3.6+,
    `collections.OrderedDict` otherwise), the order is deduced from
    the order of the attributes inside *these*.  Otherwise the order
    of the definition of the attributes is used.

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

    *auto_detect* requires Python 3. Setting it ``True`` on Python 2 raises
    an `attrs.exceptions.PythonTooOldError`.

: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] 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 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 `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 `glossary entry <slotted classes>`.
:param bool frozen: Make instances immutable after initialization.  If
    someone attempts to modify a frozen instance,
    `attr.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 (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 `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.
       `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 (Python 3+)
    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*
Nc                   > T=(       d    [        U 5      nT	SL =(       a    [        U [        5      nT=(       a    [        U S5      nU(       a  U(       a  [	        S5      e[        U TTUT[        U TTSTS9TTT
UTTUT5      n[        U TTS5      (       a  UR                  T5        TSL a  UR                  5         [        U TTS5      nU(       d  USL a  UR                  5         U(       d#  [        U TTS5      (       a  UR                  5         UR                  5         Tc  TSL a  [        U S	5      (       a  S
nOTnUSLa  US
La  Ub  [        S5      eUS
L d  Uc  US
L d  U(       a  T
(       a  [        S5      eOEUSL d  Uc  USL a  USL a  UR                  5         O"T
(       a  [        S5      eUR                  5         [        U TTS5      (       a  UR                  5         O"UR!                  5         T
(       a  [        S5      e["        (       a(  T(       a!  [        U S5      (       d  UR%                  5         UR'                  5       $ )NTr   z/Can't freeze a class with a custom __setattr__.)r   r   r   rE  )r~  r  )r  r  r  r  rc  Fr<   zlInvalid value for cache_hash.  To use hash caching, hashing must be either explicitly or implicitly enabled.)r  zFInvalid value for cache_hash.  To use hash caching, init must be True.rv  )_has_frozen_base_class
issubclassr   r   rM   r   r  rA  rH  r  r  r  rL   ri  rd  rp  r{  r	   rw  r  )r   	is_frozenr  has_own_setattrbuilderrF   rA   r   r  auto_excr  r   eq_r   r  r
  hash_rB   rE   
match_argsrJ   order_r?   repr_nsr  r   r   r	  s          r   wrapattrs.<locals>.wrap  st   94S9	T!Djm&D% 
*<+
 yNOO+!0 )
, +{M
 
 W%$;OO,k#7
 "*NN9&N
 
  Mt#"3
33DDtE 1d6FH  U]t|e    T\LR4ZI,=   
 ##%*{M
 
 ""$*  E&s,<==""$""$$r    )r  rP   rQ   rR   r   rS   )	maybe_clsr   r  r?   r@   rA   rB   r  r  r	  r   r   rE   r  r  rF   rH   r  r   r
  rJ   r   r  r  r  r  r  s    ```  `````````  `````` @@@r   r   r     sn    r ,CUDAKCE*tUm,,\\:.
k% k% k% k%^ Ir    c                 &    U R                   [        L $ )zJ
Check whether *cls* has a frozen ancestor by looking at its
__setattr__.
)r   r   r   s    r   r  r  ;  s    
 ??...r    c           	      j    SR                  UU R                  [        U SU R                  5      5      nU$ )z>
Create a "filename" suitable for a function being generated.
z<attrs generated {} {}.{}>r-   )ri   r,   r   r+   )r   	func_nameunique_filenames      r   _generate_unique_filenamer  C  s6     399^S\\2O
 r    c                 &  ^^	^
^^^ [        S T 5       5      mSn[        U S5      n[        U5      m0 m
SnSmSm	U(       d  US-  nOUS-  nUS	-  nS
T-   mT	S-  m	U/mUU	U
UUU4S jnU(       a|  TR                  US[        -  -   5        U(       a+  U" S[        -  US-  5        TR                  US-  S-   5        OU" S[        -  US-  5        TR                  US[        -  -   5        O	U" SU5        SR                  T5      n[        SXT
5      $ )Nc              3      #    U  H5  oR                   S L d   UR                   b  M   UR                  S L d  M1  Uv   M7     g7f)TN)rA   rF   r   s     r   r   _make_hash.<locals>.<genexpr>P  s/      aFFdNqvv!$$$,5s   ??	?        rA   zdef __hash__(selfzhash(())z):z, *zC, _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):z_cache_wrapper()c           	      z  > TR                  X-   T-   UST	4-  -   /5        T H~  nUR                  (       aI  SUR                  < S3nUR                  TU'   TR                  USU< SUR                  < S3-   5        M]  TR                  USUR                  -  -   5        M     TR                  US-   T-   5        g	)
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
z        %d,__keyr  (self.),z        self.%s,    N)extendrG   rj   rw   )
prefixindentr   cmp_namer   closing_bracesr]   	hash_funcmethod_lines	type_hashs
       r   append_hash_computation_lines1_make_hash.<locals>.append_hash_computation_linesl  s     	)+)55	
 Axxx()0"#((h##xHH ##F-?!&&-H$HI  	FVOn<=r    zif self.%s is None:zobject.__setattr__(self, '%s',    z
self.%s = zreturn self.%szreturn ru   rc  )rR   r  rA   rw   r(  rz   ro   )r   r   r  r  tabr  hash_defr  r\   r  r]   r  r  r  s    `       @@@@@r   rh  rh  O  sD     E C/V<O_%IE"HINDEC	
 &	1	#:L> >4 C"7:K"KKL)14EEsQw a#.)00#' 	C"25F"FFG%i5YY|$F
FUCCr    c                 &    [        XSSS9U l        U $ )z
Add a hash method to *cls*.
Frg  )rh  rc  r   r   s     r   	_add_hashr    s     c5ICLJr    c                      S n U $ )z
Create __ne__ method.
c                 P    U R                  U5      nU[        L a  [        $ U(       + $ )zR
Check equality and either forward a NotImplemented or
return the result negated.
)r~  NotImplemented)r%   otherresults      r   r  _make_ne.<locals>.__ne__  s(    
 U#^#!!zr    r#   )r  s    r   r  r    s    
	 Mr    c                    U Vs/ s H  o"R                   (       d  M  UPM     nn[        U S5      n/ SQn0 nU(       a  UR                  S5        S/nU H  nUR                  (       ai  SUR                  < S3nUR                  XW'   UR                  SU< SUR                  < S	35        UR                  SU< S
UR                  < S	35        M}  UR                  SUR                  < S35        UR                  SUR                  < S35        M     XFS/-   -  nOUR                  S5        SR                  U5      n[        SXU5      $ s  snf )z.
Create __eq__ method for *cls* with *attrs*.
rF   )zdef __eq__(self, other):z-    if other.__class__ is not self.__class__:z        return NotImplementedz    return  (z
    ) == (r  r  r  r  r  z(other.z        self.,z        other.z    )z    return Trueru   r~  )rF   r  rw   rG   rj   rz   ro   )	r   r   r   r  linesr]   othersr  r\   s	            r   r  r    s    &1QE&/T:OE E_%Axxx()0 #$(( !  ! 166;<QVV=>- 0 	7)##&'YYuF&5AA[ 's
   EEc                    ^^ T Vs/ s H  o"R                   (       d  M  UPM     snmU4S jmU4S jnU4S jnU4S jnU4S jnX4XV4$ s  snf )z1
Create ordering methods for *cls* with *attrs*.
c                 >   >^  [        S U 4S jT 5        5       5      $ )z
Save us some typing.
c              3   H   #    U  H  u  pU(       a  U" U5      OUv   M     g 7fr   r#   )r   r   r   s      r   r   6_make_order.<locals>.attrs_to_tuple.<locals>.<genexpr>  s(      

 CJ5(s    "c              3   h   >#    U  H'  n[        TUR                  5      UR                  4v   M)     g 7fr   )r   rj   rI   )r   r   objs     r   r   r    s(      =Baff%q{{3Us   /2rU  )r  r   s   `r   attrs_to_tuple#_make_order.<locals>.attrs_to_tuple  s)      
=B
 
 	
r    c                 d   > UR                   U R                   L a  T" U 5      T" U5      :  $ [        $ rO  r   r  r%   r  r  s     r   r  _make_order.<locals>.__lt__  0     ??dnn,!$'.*???r    c                 d   > UR                   U R                   L a  T" U 5      T" U5      :*  $ [        $ r  r  r  s     r   r  _make_order.<locals>.__le__  0     ??dnn,!$'>%+@@@r    c                 d   > UR                   U R                   L a  T" U 5      T" U5      :  $ [        $ r  r  r  s     r   r  _make_order.<locals>.__gt__  r  r    c                 d   > UR                   U R                   L a  T" U 5      T" U5      :  $ [        $ r  r  r  s     r   r  _make_order.<locals>.__ge__  r  r    )rH   )r   r   r   r  r  r  r  r  s    `     @r   r  r    sI     )1Q)E	
 6))c *s
   A
A
c                 b    Uc  U R                   n[        X5      U l        [        5       U l        U $ )z-
Add equality methods to *cls* with *attrs*.
)r   r  r~  r  r  r  s     r   _add_eqr     s.     }###%CJCJJr    c                    [        US5      n[        S U  5       5      nU VVVs0 s H  u  pVnU[        :w  d  M  US-   U_M     nnnn[        US'   [        US'   [
        US'   / n	U HM  u  pVn
U
(       a  SU-   OSU-   S	-   nU[        :X  a
  U< S
U< S3OU< S
U< SU< S3nU	R                  U5        MO     SR                  U	5      nUc  SnOUS-   nSSSSSSSSSSSSSU< SU< S3SS /n[        S!S"R                  U5      X8S#9$ s  snnnf )$Nr?   c              3      #    U  HN  nUR                   S Ld  M  UR                  UR                   SL a  [         OUR                   UR                  4v   MP     g7fFTN)r?   rj   rB   r   s     r   r   _make_repr.<locals>.<genexpr>4  sE      &
vvU" CQVVaffnd!&&166Bs
   A?A_reprr   r  r"   self.zgetattr(self, "z", NOTHING)z={z!r}z_repr(z)}r   z1{self.__class__.__qualname__.rsplit(">.", 1)[-1]}z.{self.__class__.__name__}zdef __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))r&   ru   )r]   )	r  rR   r?   r   r  r"   rw   rz   ro   )r   r@  r   r  attr_names_with_reprsrj   rr  r]   attribute_fragmentsr   accessorfragmentrepr_fragmentcls_name_fragmentr  s                   r   r?  r?  /  ss   3C@ !& &
&
 !
 4
3
Dy D7NA3 	 

 #i"0"i /JDQ  $&-=  9  $X.+/x@ 
  &&x0 0 		"56:C  !#%A A "H&/H1 1&7G2
$ 		%(/
 	
a
s
   D
Dc                 <   ^^ [        S U  5       5      mUU4S jnU$ )zR
Make a repr method that includes relevant *attrs*, adding *ns* to the
full name.
c              3      #    U  HC  nUR                   S Ld  M  UR                  UR                   SL a  [         OUR                   4v   ME     g7fr  )r?   rj   r   s     r   r   r  x  s>      &
vvU" 9QVVQVVt^T8s
   A4Ac                   >  [         R                  R                  n[        U 5      U;   a  gU R                  nT	c   UR                  R                  SS5      S   nOT	S-   UR                  -   nUR                  [        U 5      5         US/nSnT HH  u  pgU(       a  SnOUR                  S	5        UR                  US
U" [        X[        5      5      45        MJ     SR                  U5      S-   UR!                  [        U 5      5        $ ! [         a#    [	        5       nU[         R                  l         GNf = f! UR!                  [        U 5      5        f = f)rO  z...z>.r   rc   r   r	  TFr   = r  )r   repr_contextalready_repringr  r   idr   r-   rsplitr+   r   rw   r  r   r"   rz   remove)
r%   r  real_cls
class_namer  firstrj   	attr_reprr
  r@  s
           r   r&   _make_repr.<locals>.__repr__~  s5   G")"6"6"F"F
 $x?*~~Hz%2299$B2F
#X(9(99
 4)1$c*'<OD %d+MMsIgd'.J$KL (= wwv,&&r$x0= " G"%%7F$$4G<  &&r$x0s   D 	A'D; )D87D8;ErU  )r   r@  r  r&   r
  s    `  @r   r?  r?  o  s*     !& &
&
 !
$	1L r    c                 F    Uc  U R                   n[        X!U 5      U l        U $ )z
Add a repr method to *cls*.
)r   r?  r&   )r   r@  r   s      r   	_add_reprr!    s'     }##e-CLJr    c                     [        U [        5      (       d  [        S5      e[        U SS5      nUc  [	        SR                  U S95      eU$ )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 attr.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.
Passed object must be a class.r   N({cls!r} is not an attrs-decorated class.r   )rP   r:   rL   r   r   ri   r  s     r   fieldsr%    sV    $ c4  899C*D1E}"6==#=F
 	
 Lr    c                     [        U [        5      (       d  [        S5      e[        U SS5      nUc  [	        SR                  U S95      e[        S U 5       5      $ )a	  
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 attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
    class.

:rtype: an ordered dict where keys are attribute names and values are
    `attrs.Attribute`\ s. This will be a `dict` if it's
    naturally ordered like on Python 3.6+ or an
    :class:`~collections.OrderedDict` otherwise.

.. versionadded:: 18.1.0
r#  r   Nr$  r   c              3   <   #    U  H  oR                   U4v   M     g 7fr   r   r   s     r   r   fields_dict.<locals>.<genexpr>  s     3UUs   )rP   r:   rL   r   r   ri   r   r  s     r   fields_dictr)    sb    $ c4  899C*D1E}"6==#=F
 	
 3U333r    c           	          [         R                  SL a  g[        U R                  5       H0  nUR                  nUc  M  U" X[        XR                  5      5        M2     g)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   rj   )instr   r0  s      r   r  r    sI     %'DNN#KK=dwtVV,- $r    c                      SU R                   ;   $ )Nr$  )r   r   s    r   _is_slot_clsr.    s    #,,&&r    c                 2    X;   =(       a    [        X   5      $ )z6
Check if the attribute name comes from a slot class.
)r.  )a_namer   s     r   _is_slot_attrr1    s     "J|M4I'JJr    c                 >   U	S L=(       a    U	[         R                  LnU(       a  U(       a  [        S5      eU=(       d    Un/ n0 nU H  nUR                  (       d  UR                  [
        L a  M)  UR                  U5        XUR                  '   UR                  b  USL a  [        S5      eSnMi  U(       d  Mr  UR                  [         R                  Ld  M  SnM     [        U S5      n[        UUUUUUUUUU
5
      u  nnnU R                  [        R                  ;   a6  UR                  [        R                  U R                     R                  5        UR                  [
        US.5        U(       a	  [         US'   [#        U
(       a  SOSUUU5      nUUl        U$ )Nz$Frozen classes can't use on_setattr.TrB   )r"   	attr_dict_setattrrz  r  )r   r  rM   rB   r=   r"   rw   rj   rJ   r  _attrs_to_init_scriptr,   sysmodulesr'  r   r  ro   r   )r   r   pre_init	post_initr  r  r  r   r  cls_on_setattrrm  has_cls_on_setattrneeds_cached_setattrfiltered_attrsr3  r   r  r\   r]   annotationsrB   s                        r   ro  ro    sw    	d"J~W]]'J  $?@@%/NIvv!))w.a !&&<<#~ !GHH#' ALL$E#'   0V<O!6"FE; ~~$S[[099:	LLW9=> )j&J	D 'DKr    c                     SU < SU< S3$ )zB
Use the cached object.setattr to set *attr_name* to *value_var*.
_setattr(self, '', r  r#   rr   	value_varhas_on_setattrs      r   r4  r4  P  s     *3I>>r    c                 0    SU < S[         U 4-  < SU< S3$ )z_
Use the cached object.setattr to set *attr_name* to *value_var*, but run
its converter first.
r@  rA  r	  r  )_init_converter_patrB  s      r   _setattr_with_converterrG  W  s     	yl* r    c                 <    U(       a  [        XS5      $ SU < SU< 3$ )zc
Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
relegate to _setattr.
Tr   = )r4  )rr   r   rD  s      r   _assignrJ  c  s&    
 	$//  '..r    c                 V    U(       a  [        XS5      $ SU < S[        U 4-  < SU< S3$ )z
Unless *attr_name* has an on_setattr hook, use normal assignment after
conversion. Otherwise relegate to _setattr_with_converter.
Tr  rI  r	  r  )rG  rF  rB  s      r   _assign_with_converterrL  n  s5    
 &yTBB  	yl* r    c
           
      4  ^ / n
U(       a  U
R                  S5        USL a0  USL a  [        n[        nO*U
R                  S5        U4S jnU4S jnO[        n[        n/ n/ n/ n0 nSS0nU  GH1  nUR
                  (       a  UR                  U5        UR                  nUR                  SL=(       d%    UR                  [        R                  L=(       a    UnUR                  R                  S5      n[        UR                  [        5      nU(       a  UR                  R                  (       a  S	nOS
nUR                  SL Ga$  U(       a  [         R#                  UR                  5      nUR$                  bE  U
R                  U" UUSU< S3-   U5      5        [&        UR                  4-  nUR$                  UU'   O!U
R                  U" UUSU< S3-   U5      5        UR                  R(                  UU'   GO%UR$                  bC  U
R                  U" USU< S3U5      5        [&        UR                  4-  nUR$                  UU'   GOU
R                  U" USU< S3U5      5        GOUR                  [*        La  U(       d  U< SU< S3nUR,                  (       a  UR                  U5        OUR                  U5        UR$                  b<  U
R                  U" UUU5      5        UR$                  U[&        UR                  4-  '   GOU
R                  U" UUU5      5        GOU(       Ga\  U< S3nUR,                  (       a  UR                  U5        OUR                  U5        U
R                  SU< S35        [         R#                  UR                  5      nUR$                  bt  U
R                  SU" UUU5      -   5        U
R                  S5        U
R                  SU" UUS-   U-   S-   U5      -   5        UR$                  U[&        UR                  4-  '   ORU
R                  SU" UUU5      -   5        U
R                  S5        U
R                  SU" UUS-   U-   S-   U5      -   5        UR                  R(                  UU'   OUR,                  (       a  UR                  U5        OUR                  U5        UR$                  b;  U
R                  U" UUU5      5        UR$                  U[&        UR                  4-  '   OU
R                  U" UUU5      5        UR                  SL d  GM  UR.                  b  UR$                  c  UR.                  UU'   GM  UR$                  c  GM  [1        UR$                  5      R3                  5       nU(       d  GM,  UUU'   GM4     U(       a}  [4        US'   U
R                  S5        U H]  nSUR                  -   nSUR                  -   nU
R                  SU< SU< SUR                  < S35        UR
                  UU'   UUU'   M_     U(       a  U
R                  S5        U(       a0  U(       a  U(       a  SnOSnOSnU
R                  U[6        S 4-  5        U(       a.  S!R9                  S" U  5       5      nU
R                  S#U< S35        S$R9                  U5      nU(       a$  UU(       a  S$OS
< S%S$R9                  U5      < 3-  nS&R#                  U	(       a  S'OS(UU
(       a  S)R9                  U
5      OS*S+9UU4$ ),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__``.
zself.__attrs_pre_init__()Tz_inst_dict = self.__dict__c                 R   > [        U T5      (       a  [        XU5      $ SU < SU< 3$ )N_inst_dict[''] = )r1  r4  rr   rC  rD  r   s      r   
fmt_setter)_attrs_to_init_script.<locals>.fmt_setter  s/     M::#I.II ; 3<YGGr    c                 z   > U(       d  [        U T5      (       a  [        XU5      $ SU < S[        U 4-  < SU< S3$ )NrO  rP  r	  r  )r1  rG  rF  rQ  s      r   fmt_setter_with_converter8_attrs_to_init_script.<locals>.fmt_setter_with_converter  sH     "]9m%L%L2!n  &M '9,6 r    returnNr  r%   r  Fr	  r  zattr_dict['z
'].defaultz=attr_dict['z=NOTHINGzif z is not NOTHING:r  zelse:r   z#if _config._run_validators is True:__attr_validator___attr_z(self, z, self.zself.__attrs_post_init__()z_setattr(self, '%s', %s)z_inst_dict['%s'] = %szself.%s = %sNoner  c              3   d   #    U  H&  oR                   (       d  M  S UR                  -   v   M(     g7f)r  N)rB   rj   r   s     r   r   (_attrs_to_init_script.<locals>.<genexpr>v	  s      B%Q66(!&&(%s   00zBaseException.__init__(self, r   z*, z+def {init_name}(self, {args}):
    {lines}
rz  r  z
    pass)	init_nameargsr  )rw   r4  rG  rJ  rL  r>   rj   rJ   r   r  lstriprP   r=   rO   
takes_selfrB   _init_factory_patri   rC   rF  rV   r"   rE   r:   r   get_first_param_typer   r(  rz   )r   r  r  r8  r9  r  r   r  r;  rm  r  rR  rU  r_  kw_only_argsattrs_to_validatenames_for_globalsr>  r   rr   rD  arg_namehas_factory
maybe_selfinit_factory_name	conv_nameargtval_nameinit_hash_cachevalss         `                        r   r5  r5  }  sS   ( E01~D=!J(?% LL56H  
$:!DL T"K;;$$Q'FF	T1 
LL-D2D 	 66==% G4199//JJ66U?$5$<$<QVV$D!;;*LL1%-*0FF* !4qvvi ?I34;;%i0LL"%-*0FF* 89yy7H7H!"34;;*LL1%9BD* !4qvvi ?I34;;%i0LL"%9BD* YYg%k2:IFCyy##C(C {{&-!8^ KK "'166)3 Z	8^LM"*,Cyy##C(C LLH>? 1 8 8 @{{&/!8^ W%/!)C/*<sB& KK "'166)3 Z	8^LL W% !)C/*<sB& 45993D3D/0yy##H-H%{{&-!8^ KK "'166)3 Z	8^LM66T>vv!akk&9()H%((5JJL1,-K)_ b '.)$:;"A*QVV3H!AFF*ILL/7AFFK +,++h'+,i( # 12 "< #:,O_(96'BBC xxB%BB4AB99T?DDb IIl#
 	

	 F+5':*/(--&V  

 	 r    c                   j    \ rS rSrSrSr         SS jrS r\SS j5       r	S r
S	 rS
 rS rSrg)r   i	  a  
*Read-only* representation of an attribute.

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

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

For the full version history of the fields, see `attr.ib`.
)rj   r=   r>   r?   rF   rG   rH   rI   rA   rB   rD   r:   rC   rE   r   rJ   Nc                    [        X^=(       d    UU=(       d    US5      u  pnn[        R                  U [        5      nU" SU5        U" SU5        U" SU5        U" SU5        U" SU5        U" SU5        U" SU5        U" S	U5        U" S
U5        U" SU5        U" SU5        U" SU	(       a  [        R
                  " [        U	5      5      O[        5        U" SU
5        U" SU5        U" SU5        U" SU5        g )NTrj   r=   r>   r?   rF   rG   rH   rI   rA   rB   rC   rD   r:   rE   r   rJ   )rK   r  rZ  r   typesMappingProxyTyper  _empty_metadata_singleton)r%   rj   r=   r>   r?   r@   rA   rB   r   rD   r:   rC   rE   rF   rG   rH   rI   rJ   bound_setattrs                      r   r  Attribute.__init__	  s    ( (B2y1E4(
$E9
 %,,T9= 	fd#i)k9-fd#dBh'gu%k9-fd#fd#k9-  &&tH~6.	
 	fd#i)k9-lJ/r    c                     [        5       er   r   r   s      r   r   Attribute.__setattr__	  s    !##r    c           
         Uc  UR                   nOUR                   b  [        S5      e[        R                   Vs0 s H  nUS;  d  M  U[	        X$5      _M     nnU " SUUR
                  UR                  US SS.UD6$ s  snf )Nz8Type annotation and type argument cannot both be present)rj   r>   r=   r:   r   F)rj   r>   r=   r:   r@   r   r#   )r:   rM   r   r$  r   
_validator_default)r   rj   r   r:   r/  	inst_dicts         r   r   Attribute.from_counting_attr	  s     <77DWW J 
 ((
( Awr~( 	 
  
mmKK
 
 	

s   
A>	A>c                 p    [         R                   " U 5      nUR                  UR                  5       5        U$ )z
Copy *self* and apply *changes*.

This works similarly to `attr.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      r   r   Attribute.evolve
  s(     iiogmmo&
r    c                 B   ^  [        U 4S jT R                   5       5      $ )
Play nice with pickle.
c              3   r   >#    U  H,  nUS :w  a  [        TU5      O[        TR                  5      v   M.     g7f)rD   N)r   r  rD   rR  s     r   r   )Attribute.__getstate__.<locals>.<genexpr>1
  s4      
& $(:#5GD$4;NN&s   47rR   r$  r$   s   `r   r   Attribute.__getstate__-
  s#      

 
 	
r    c                 N    U R                  [        U R                  U5      5        gr  N)r  r[  r$  )r%   r\  s     r   r   Attribute.__setstate__6
  s     	s4>>512r    c           	          [         R                  U [        5      nU HH  u  p4US:w  a
  U" X45        M  U" UU(       a  [        R                  " [        U5      5      O[        5        MJ     g )NrD   )r  rZ  r   rs  rt  r  ru  )r%   name_values_pairsrv  rj   r   s        r   r  Attribute._setattrs<
  sU    $,,T9=,KDz!d* **4;72		 -r    r#   )	NNNFNNNNNr   )r+   r,   r-   r.   r/   r$  r  r   r*  r   r   r   r   r  r0   r#   r    r   r   r   	  s_    BI: %30j$ 
 
>$
3r    r   rD   )
rj   r=   r>   r?   r@   rF   rH   rA   rB   r   )r   r   c                   z    \ rS rSrSrSr\" S S 5       5      \" SSSSSS	SS	SSS	SS	SS
94-   rSr	S r
S rS rSrg)rU   ic
  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   r|  r?   rF   rG   rH   rI   rA   rB   rD   r{  rC   r:   rE   rJ   c              #   V   #    U  H  n[        U[        S SS SSSSS SS SS S9v   M!     g 7f)NTFrj   r=   r>   r?   r@   rA   rB   rE   rF   rG   rH   rI   r   rJ   )r   r"   )r   rj   s     r   r   _CountingAttr.<genexpr>}
  sJ      "	
D! 		
 	
s   '))r   r|  r?   rF   rH   rA   rB   rJ   rD   NTFr  r   c                    [         =R                  S-  sl        [         R                  U l        Xl        X l        Xpl        X0l        Xl        Xl        Xl	        Xl
        XPl        X`l        Xl        Xl        Xl        Xl        g r   )rU   cls_counterr   r|  r{  rC   r?   rF   rG   rH   rI   rA   rB   rD   r:   rE   rJ   )r%   r=   r>   r?   r@   rA   rB   rC   rD   r:   rE   rF   rG   rH   rI   rJ   s                   r   r  _CountingAttr.__init__
  sh    $ 	!!Q&!$00#"	
"		 	$r    c                 f    U R                   c  Xl         U$ [        U R                   U5      U l         U$ )zl
Decorator that adds *meth* to the list of validators.

Returns *meth* unchanged.

.. versionadded:: 17.1.0
)r{  rT   r%   r  s     r   r>   _CountingAttr.validator
  s3     ??""O  #4??D9DOr    c                 ^    U R                   [        La
  [        5       e[        USS9U l         U$ )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)ra  )r|  r"   r   rO   r  s     r   r=   _CountingAttr.default
  s,     =='(**6r    )r|  r{  rC   r   rF   rG   rA   rB   rE   rD   rJ   rH   rI   r?   r:   )r+   r,   r-   r.   r/   r$  rR   r   r   r  r  r>   r=   r0   r#   r    r   rU   rU   c
  s    I"  "	
# 8 		
	7,OZ K!%Fr    rU   c                   2    \ rS rSrSrSrSS jrS rS rSr	g)	rO   i
  a  
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*
rV   ra  c                     Xl         X l        g)zs
`Factory` is part of the default machinery so if we want a default
value here, we have to implement it ourselves.
Nr  )r%   rV   ra  s      r   r  Factory.__init__  s    
 $r    c                 B   ^  [        U 4S jT R                   5       5      $ )r  c              3   <   >#    U  H  n[        TU5      v   M     g 7fr   rQ  rR  s     r   r   'Factory.__getstate__.<locals>.<genexpr>  s     D^TWT4((^rT  r  r$   s   `r   r   Factory.__getstate__  s     DT^^DDDr    c                 Z    [        U R                  U5       H  u  p#[        XU5        M     gr  )r[  r$  r  )r%   r\  rj   r   s       r   r   Factory.__setstate__  s%     t~~u5KDD& 6r    N)F)
r+   r,   r-   r.   r/   r$  r  r   r   r0   r#   r    r   rO   rO   
  s     *I%E'r    rO   c                   ^ [        U[        5      (       a  UnOA[        U[        [        45      (       a  U Vs0 s H  oU[	        5       _M     nnO[        S5      eUR                  SS5      nUR                  SS5      nUR                  SS5      n0 mUb  UTS'   Ub  UTS'   Ub  UTS'   [        R                  " X0 U4S j5      n	 [        R                  " S5      R                  R                  SS	5      U	l        UR                  S
S5      n
[!        U
UR                  S5      UR                  S5      S5      u  US'   US'   [#        SSU0UD6" U	5      $ s  snf ! [        [        4 a     Nqf = f)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
    attributes.

    If *attrs* is a list or an ordered dict (`dict` on Python 3.6+,
    `collections.OrderedDict` otherwise), 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.
z(attrs argument must be a dict or a list.r   Nr   r  c                 &   > U R                  T5      $ r   )r'  )r@  bodys    r   r   make_class.<locals>.<lambda>X  s    		$r    r   r+   __main__r@   rF   rH   Tr   r#   )rP   r  rQ   rR   rW   rL   poprs  	new_classr6  	_getframe	f_globalsr   r,   r  rM   r  r   )rj   r   basesattributes_argumentscls_dictr   r8  r9  	user_inittype_r@   r  s              @r   
make_classr  ,  s   2 %	ED%=	)	))./AvxK/BCC||0$7H2D9IZ.ID%-!"&/"#$ZOOD-GHE==+5599

 
"
"5$
/C 	"  &  )		T"W% 99$89%@@S 04 J' s   E5E E/.E/)r  rA   c                   ,    \ rS rSrSr\" 5       rS rSrg)_AndValidatorix  z*
Compose many validators to a single one.
c                 <    U R                    H  nU" XU5        M     g r   )_validators)r%   r,  r   r   r0  s        r   __call___AndValidator.__call__  s    !!Ad%  "r    r#   N)	r+   r,   r-   r.   r/   rW   r  r  r0   r#   r    r   r  r  x  s     (K!r    r  c                      / nU  H6  nUR                  [        U[        5      (       a  UR                  OU/5        M8     [        [	        U5      5      $ )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  rP   r  r  rR   )
validatorsrp  r>   s      r   rT   rT     sM     D	)]33 !!	
   t%%r    c                  (  ^  U 4S jnT (       d!  [         R                  " S5      nX"S.Ul        U$ [        T S   5      R	                  5       nU(       a  X1R                  S'   [        T S   5      R                  5       nU(       a  XAR                  S'   U$ )a9  
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                 *   > T H  nU" U 5      n M     U $ r   r#   )r  rC   
converterss     r   pipe_converterpipe.<locals>.pipe_converter  s    #IC.C $ 
r    A)r  rW  r   r  rc   rW  )typingTypeVarr   r   rc  get_return_type)r  r  r  rm  rts   `    r   rS   rS     s     NN312)@&  !A/DDF45**51 "*R.1AAC79**84r    )Nr  )T)NNNNNNNFFTFFFFFNNFFNNNTr   )NN)\r  rf   r6  rs  r  operatorr   r  r   r   r   r   r	   r
   r   r   r   
exceptionsr   r   r   r   objectr   r  rF  rb  rx   r   r(  rt  ru  r   rS   r  r  r  r   r"   intr3   rW   ra   ro   r   r   r   r   r   r   r   r   r   r   r   r   r  rK   r  r   r   r  r  rh  r  r  r  r  r  r?  r!  r%  r)  r.  r1  ro  r4  rG  rJ  rL  r5  r   r$  _arj   rA   rU   rO   _fr  r  rT   )rj   r   s   00r   <module>r     s     
    ( '   !!+ ' C   ) !2226  H	 goow7G7GH  . *
( (" 				
AH :": %
0"$#>%8jGZ $$ M M`4&(T .26 
			

/Qh 
/	GDT&1Bh5*p
 <
@5p848."'KGT?	/Nby yR ## $ j  $  )2&6"Q+ 5q"6 
=bFF1qvv'<1b
=	I IX 	-01$' $'h !! "  "  GIgR8C2
N $*) EAX T	! 	! 	!&*$a
& 7
=ts*   J$J)"J)0J.
J.
J.
J3