HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.7/__pycache__/dataclasses.cpython-37.pyc
B

{a|@sddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gddde
ZGdddZeZ
GdddZeZeiZGdddZedZedZedZdZdZdZedZGdddeZGdddedZGd ddZGd!d"d"Zeed#d#dd#dd$d%dZ d&d'Z!d(d)Z"dded*d+d,Z#d-d.Z$d/d0Z%d1d2Z&d3d4Z'd5d6Z(d7d8Z)d9d:Z*d;d<Z+d=d>Z,d?d@Z-dAdBZ.dCdDZ/dEdFZ0dGdHZ1dIdJZ2dKdLZ3dddde1de2de2e3e2e3e2e3e2e3dMZ4dNdOZ5dcd#d#d#dPdPdPdQdRdZ6dSdZ7dTdUZ8dVd
Z9e:dWdXd	Z;dYdZZ<e=d[d\d
Z>d]d^Z?d_dd#d#d#dPdPdPd`dadZ@dbdZAdS)dN	dataclassfieldFieldFrozenInstanceErrorInitVarMISSINGfieldsasdictastuplemake_dataclassreplaceis_dataclassc@seZdZdS)rN)__name__
__module____qualname__rr!/usr/lib/python3.7/dataclasses.pyrsc@seZdZddZdS)_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r)selfrrr__repr__sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrrsrc@seZdZdS)
_MISSING_TYPEN)rrrrrrrrsrc@seZdZddZddZdS)_FIELD_BASEcCs
||_dS)N)name)rrrrr__init__sz_FIELD_BASE.__init__cCs|jS)N)r)rrrrrsz_FIELD_BASE.__repr__N)rrrrrrrrrrsr_FIELD_FIELD_CLASSVAR_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZddZdS)_InitVarMetacCs|S)Nr)rZparamsrrr__getitem__sz_InitVarMeta.__getitem__N)rrrrrrrrrsrc@seZdZdS)rN)rrrrrrrrs)	metaclassc@s(eZdZdZddZddZddZdS)	r)
rtypedefaultdefault_factoryreprhashinitcomparemetadata_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	
||_d|_dS)N)
rr r!r"r%r#r$r&_EMPTY_METADATAtypesMappingProxyTyper'r()rr!r"r%r#r$r&r'rrrrszField.__init__cCsVd|jd|jd|jd|jd|jd|jd|jd|jd	|jd
|j	dS)NzField(name=z,type=z	,default=z,default_factory=z,init=z,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=))
rr r!r"r%r#r$r&r'r()rrrrrszField.__repr__cCs(tt|jdd}|r$||j||dS)N__set_name__)getattrr r!)rownerrfuncrrrr-szField.__set_name__N)rrr	__slots__rrr-rrrrrsc@s eZdZdZddZddZdS)_DataclassParams)r%r#eqorderunsafe_hashfrozencCs(||_||_||_||_||_||_dS)N)r%r#r3r4r5r6)rr%r#r3r4r5r6rrrrsz_DataclassParams.__init__c
Cs6d|jd|jd|jd|jd|jd|jd
S)Nz_DataclassParams(init=z,repr=z,eq=z,order=z
,unsafe_hash=z,frozen=r,)r%r#r3r4r5r6)rrrrr'sz_DataclassParams.__repr__N)rrrr1rrrrrrr2sr2T)r!r"r%r#r$r&r'cCs,|tk	r|tk	rtdt|||||||S)aReturn an object to identify dataclass fields.

    default is the default value of the field.  default_factory is a
    0-argument function called to initialize a field's value.  If init
    is True, the field will be a parameter to the class's __init__()
    function.  If repr is True, the field will be included in the
    object's repr().  If hash is True, the field will be included in
    the object's hash().  If compare is True, the field will be used
    in comparison functions.  metadata, if specified, must be a
    mapping which is stored but not otherwise examined by dataclass.

    It is an error to specify both default and default_factory.
    z/cannot specify both default and default_factory)r
ValueErrorr)r!r"r%r#r$r&r'rrrr5scs(|sdSddfdd|DdS)Nz()(,csg|]}d|jqS).)r).0f)obj_namerr
<listcomp>Tsz_tuple_str.<locals>.<listcomp>z,))join)r=rr)r=r
_tuple_strKsr@cs"ttfdd}|S)Nc	sDt|tf}|krdS|z|}Wd|X|S)Nz...)id_thread	get_identadddiscard)rkeyresult)repr_running
user_functionrrwrapper^s
z _recursive_repr.<locals>.wrapper)set	functoolswraps)rIrJr)rHrIr_recursive_reprYsrN)globalslocalsreturn_typecCs|dkri}|dk	r$d|kr$t|d<d}|tk	r<||d<d}d|}ddd|D}d	|d
|d|d|}t|||||S)
N__builtins__Z_return_typez->_return_typer9
css|]}d|VqdS) Nr)r;brrr	<genexpr>}sz_create_fn.<locals>.<genexpr>zdef r8r,z:
)builtinsrr?exec)rargsZbodyrOrPrQZreturn_annotationZtxtrrr
_create_fnls
r[cCs0|rd|d|d|dS|d|d|S)Nz __builtins__.object.__setattr__(r9r,r:=r)r6rvalue	self_namerrr
_field_assignsr_cCsd|j}|jtk	rV|jr@|j||<|d|jd|j}q|j||<|d}n8|jr|jtkrn|j}q|jtk	r|j||<|j}ndS|jtkrdSt||j||S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else z())rr"rr%r!r(rr_)r<r6rOr^Zdefault_namer]rrr_field_inits"






r`cCsV|jtkr|jtkrd}n&|jtk	r2d|j}n|jtk	r@d}|jd|j|S)NrSz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r!rr"r)r<r!rrr_init_params

racCsd}xB|D]:}|jr
|jtkr(|jtks.d}q
|r
td|jdq
Wttd}g}x(|D] }t||||}|r\||q\W|rd	dd|D}	||d	t
d
|	d|sdg}d
d|D}
td|gdd|D||
|ddS)NFTznon-default argument z follows default argument)r_HAS_DEFAULT_FACTORYr9css|]}|jtkr|jVqdS)N)r(rr)r;r<rrrrWsz_init_fn.<locals>.<genexpr>r:r8r,passcSsi|]}|jd|jqS)Z_type_)r r)r;r<rrr
<dictcomp>sz_init_fn.<locals>.<dictcomp>rcSsg|]}|jrt|qSr)r%ra)r;r<rrrr>sz_init_fn.<locals>.<listcomp>)rPrOrQ)r%r!rr"	TypeErrorrrbr`appendr?_POST_INIT_NAMEr[)rr6
has_post_initr^Zseen_defaultr<rOZ
body_lineslineZ
params_strrPrrr_init_fns4

rjcCs.tdddddd|Ddg}t|S)Nr)rz(return self.__class__.__qualname__ + f"(z, cSs g|]}|jd|jdqS)z={self.z!r})r)r;r<rrrr>sz_repr_fn.<locals>.<listcomp>z)")r[r?rN)rfnrrr_repr_fns

rlcCsl|td}|r,dddd|Dd}nd}tdd	d
|ddd
f|dtddd
|dddf|dfS)N)clsrr8r9css|]}t|jVqdS)N)r#r)r;r<rrrrWsz'_frozen_get_del_attr.<locals>.<genexpr>z,)z()__setattr__)rrr]z if type(self) is cls or name in :z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rO__delattr__)rrz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rr?r[)rmrrOZ
fields_strrrr_frozen_get_del_attrs"

rqcCs t|ddd|||dgS)N)rotherz%if other.__class__ is self.__class__:z return zreturn NotImplemented)r[)rop
self_tupleother_tuplerrr_cmp_fn.s
rvcCs td|}tddd|dgS)Nr__hash__)rzreturn hash(r,)r@r[)rrtrrr_hash_fn;s
rxcCs$||jkp"t||jko"|j|jkS)N)ClassVarr Z
_GenericAliasZ
__origin__)a_typetypingrrr_is_classvarBs
r|cCs
||jkS)N)r)rzdataclassesrrr_is_initvarJsr~c	Cst|}|rd}|d}|s2tj|jj}n2tj|j}|rd|j||krdtj|jj}|r|||d|rdSdS)NTF)_MODULE_IDENTIFIER_REmatchgroupsysmodulesgetr__dict__)	Z
annotationrmZa_modulerzZis_type_predicaternsZmodule_namemodulerrr_is_typePs)

rcCs8t||t}t|tr|}nt|tjr,t}t|d}||_||_t	|_
tj
d}|rt||st|jtrt|j|||jtrt|_
|j
t	krtjt}t||st|jtrt|j|||jtrt|_
|j
ttfkr|jtk	rtd|jd|j
t	kr4t|jtttfr4tdt|jd|jd|S)N)r!r{zfield z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r.r
isinstancerr*MemberDescriptorTyperrr rr(rrrr|strrryrrr~rrr"rer!listdictrKr7)rmZa_namerzr!r<r{r}rrr
_get_fields:






	 rcCs||jkrdSt|||dS)NTF)rsetattr)rmrr]rrr_set_new_attributes
rcCsdS)Nr)rmrrrr_hash_set_nonesrcCsdd|D}t|S)NcSs(g|] }|jdkr|jrn|jr|qS)N)r$r&)r;r<rrrr>sz_hash_add.<locals>.<listcomp>)rx)rmrfldsrrr	_hash_addsrcCstd|jdS)Nz-Cannot overwrite attribute __hash__ in class )rer)rmrrrr_hash_exceptionsr))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTc
sxi}ttt||||||d}d}	xXjdddD]D}
t|
td}|r8d}	x|D]}|||j<qZWt|
tjr8d}q8Wj	
di}
fdd|
D}xR|D]J}|||j<tt|jdt
r|jtkrt|jqt|j|jqWx<j	D].\}}t|t
r||
krt|dqW|	rd|rP|sPtd	|sd|rdtd
tt|j	
dt}|tkp|dkodj	k}|r|std
|rtt}dd|D}tdt|||d|krdnddd|D}|r.dd|D}tdt||rldd|D}td|}td|}tdtdd|||rdd|D}td|}td|}xBdD]:\}}t|t||||rtd|djdqW|rx<t|D].}t|j|rtd|jdjqWtt|t|t||f}|rJ||_tdstjtt !"dd_#S) NFrT__annotations__csg|]\}}t||qSr)r)r;rr )rmrrr>Asz"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen onerw__eq__z eq must be true if order is truecSsg|]}|jttfkr|qSr)r(rr)r;r<rrrr>~srrZ__dataclass_self__cSsg|]}|jtkr|qSr)r(r)r;r<rrrr>scSsg|]}|jr|qSr)r#)r;r<rrrr>srcSsg|]}|jr|qSr)r&)r;r<rrrr>srrz==cSsg|]}|jr|qSr)r&)r;r<rrrr>s))__lt__<)__le__z<=)__gt__>)__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering__doc__z -> NonerS)$r_PARAMSr2__mro__r._FIELDSvaluesrr6rritemsrrr!rdelattrrer7hasattrrgrrjrlr@rvrrq_hash_actionboolrwrinspectZ	signaturerr)rmr%r#r3r4r5r6rZany_frozen_baseZhas_dataclass_basesrVZbase_fieldsr<Zcls_annotationsZ
cls_fieldsrr]Z
class_hashZhas_explicit_hashrhrZ
field_listrtrursrkZhash_actionr)rmr_process_classs











rF)r%r#r3r4r5r6cs*fdd}|dkr"|S||S)aReturns the same class as was passed in, with dunder methods
    added based on the fields defined in the class.

    Examines PEP 526 __annotations__ to determine fields.

    If init is true, an __init__() method is added to the class. If
    repr is true, a __repr__() method is added. If order is true, rich
    comparison dunder methods are added. If unsafe_hash is true, a
    __hash__() method function is added. If frozen is true, fields may
    not be assigned to after instance creation.
    cst|S)N)r)rm)r3r6r%r4r#r5rrwrapszdataclass.<locals>.wrapNr)_clsr%r#r3r4r5r6rr)r3r6r%r4r#r5rrscCsByt|t}Wntk
r*tdYnXtdd|DS)zReturn a tuple describing the fields of this dataclass.

    Accepts a dataclass or an instance of one. Tuple elements are of
    type Field.
    z0must be called with a dataclass type or instancecss|]}|jtkr|VqdS)N)r(r)r;r<rrrrWszfields.<locals>.<genexpr>)r.rAttributeErrorretupler)Zclass_or_instancerrrrrs
cCst|tot|tS)z2Returns True if obj is an instance of a dataclass.)rr rr)objrrr_is_dataclass_instancesrcCs
t|tS)zEReturns True if obj is a dataclass or an instance of a
    dataclass.)rr)rrrrr
s)dict_factorycCst|stdt||S)aReturn the fields of a dataclass instance as a new dictionary mapping
    field names to field values.

    Example usage:

      @dataclass
      class C:
          x: int
          y: int

      c = C(1, 2)
      assert asdict(c) == {'x': 1, 'y': 2}

    If given, 'dict_factory' will be used instead of built-in dict.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z0asdict() should be called on dataclass instances)rre
_asdict_inner)rrrrrr	scst|rHg}x2t|D]&}tt||j}||j|fqW|St|trvt|drvt	|fdd|DSt|t
tfrt	|fdd|DSt|trt	|fdd|DSt
|SdS)N_fieldscsg|]}t|qSr)r)r;v)rrrr>2sz!_asdict_inner.<locals>.<listcomp>c3s|]}t|VqdS)N)r)r;r)rrrrW7sz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|t|fVqdS)N)r)r;kr)rrrrW9s)rrrr.rrfrrrr rrrcopydeepcopy)rrrGr<r]r)rrrs
r)
tuple_factorycCst|stdt||S)aReturn the fields of a dataclass instance as a new tuple of field values.

    Example usage::

      @dataclass
      class C:
          x: int
          y: int

    c = C(1, 2)
    assert astuple(c) == (1, 2)

    If given, 'tuple_factory' will be used instead of built-in tuple.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z1astuple() should be called on dataclass instances)rre_astuple_inner)rrrrrr
@scst|rBg}x,t|D] }tt||j}||qW|St|trpt|drpt	|fdd|DSt|t
tfrt	|fdd|DSt|trt	|fdd|DSt
|SdS)Nrcsg|]}t|qSr)r)r;r)rrrr>fsz"_astuple_inner.<locals>.<listcomp>c3s|]}t|VqdS)N)r)r;r)rrrrWksz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|t|fVqdS)N)r)r;rr)rrrrWms)rrrr.rrfrrrr rrrrr)rrrGr<r]r)rrrXs
rr)bases	namespacer%r#r3r4r5r6c	sdkrint}
i}x|D]}t|tr>|}
d}nDt|dkrT|\}
}n.t|dkrt|\}
}}||
<ntd|t|
tr|
std|
t|
rtd|
|
|
krtd|
|
	|
|||
<q&W|d	<t
||ifd
d}t|||||||	dS)
aReturn a new dynamically created dataclass.

    The dataclass name will be 'cls_name'.  'fields' is an iterable
    of either (name), (name, type) or (name, type, Field) objects. If type is
    omitted, use the string 'typing.Any'.  Field objects are created by
    the equivalent of calling 'field(name, type [, Field-info])'.

      C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))

    is equivalent to:

      @dataclass
      class C(Base):
          x: 'typing.Any'
          y: int
          z: int = field(init=False)

    For the bases and namespace parameters, see the builtin type() function.

    The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
    dataclass().
    Nz
typing.AnyrzInvalid field: z&Field names must be valid identifers: z"Field names must not be keywords: zField name duplicated: rcs
|S)N)update)r)rrr<lambda>z make_dataclass.<locals>.<lambda>)r%r#r3r4r5r6)
rrKrrlenreisidentifierkeyword	iskeywordrDr*	new_classr)Zcls_namerrrr%r#r3r4r5r6seenZannsitemrtpspecrmr)rrrss6






cKst|stdx~t|tD]l}|jtkr0q |jsT|j|kr t	d|jdq |j|kr |jt
krzt	d|jdt||j||j<q W|jf|S)a,Return a new object replacing specified fields with new values.

    This is especially useful for frozen classes.  Example usage:

      @dataclass(frozen=True)
      class C:
          x: int
          y: int

      c = C(1, 2)
      c1 = replace(c, x=3)
      assert c1.x == 3 and c1.y == 2
      z1replace() should be called on dataclass instanceszfield zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())rrer.rrr(rr%rr7r	__class__)rZchangesr<rrrrs



)N)Brerrr*rrrXrLrB__all__rrrrbrrr+r)rrrrrrrgcompilerr rrrr2rr@rNr[r_r`rarjrlrqrvrxr|r~rrrrrrrrrrrr
rr	rrr
rrrrrrr<module>s

:60

;R4
)@