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__/functools.cpython-37.pyc
B

{a~@sdZddddddddd	d
dgZydd
lmZWnek
rBYnXddlmZddlmZddl	m
Z
ddlmZdZ
dZe
efddZe
efddZefddZefddZefddZefddZefddZefd d!Zefd"d#Zefd$d%Zefd&d'Zefd(d)Zefd*d+Zefd,d-Zd.efd/efd0efgd0efd1efd.efgd1efd0efd/efgd/efd.efd1efgd2Zd3dZd4dZ ydd5lm Z Wnek
rYnXGd6d	d	Z!ydd7lm!Z!Wnek
rYnXGd8d
d
e"Z#ed9d:d;d<d=gZ$Gd>d?d?e%Z&e"fe'e(he)e*e+fd@dAZ,dRdDdZ-dEdFZ.yddGlm.Z.Wnek
rrYnXdHdIZ/dSdKdLZ0dMdNZ1dOdPZ2dQdZ3dJS)TzEfunctools.py - Tools for working with functions and callable objects
update_wrapperwrapsWRAPPER_ASSIGNMENTSWRAPPER_UPDATEStotal_ordering
cmp_to_key	lru_cachereducepartial
partialmethodsingledispatch)r)get_cache_token)
namedtuple)recursive_repr)RLock)
__module____name____qualname____doc____annotations__)__dict__c	Csnx<|D]4}yt||}Wntk
r,YqXt|||qWx$|D]}t||t||iqDW||_|S)aUpdate a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    )getattrAttributeErrorsetattrupdate__wrapped__)wrapperwrappedassignedupdatedattrvaluer"/usr/lib/python3.7/functools.pyr%s

cCstt|||dS)aDecorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    )rrr)r	r)rrrr"r"r#rCscCs$||}||kr|S|o"||kS)zIReturn a > b.  Computed by @total_ordering from (not a < b) and (a != b).)__lt__)selfotherNotImplemented	op_resultr"r"r#_gt_from_lt[s
r)cCs||}|p||kS)zEReturn a <= b.  Computed by @total_ordering from (a < b) or (a == b).)r$)r%r&r'r(r"r"r#_le_from_ltbs
r*cCs||}||kr|S|S)z=Return a >= b.  Computed by @total_ordering from (not a < b).)r$)r%r&r'r(r"r"r#_ge_from_ltgs
r+cCs$||}||kr|S|p"||kS)zJReturn a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).)__le__)r%r&r'r(r"r"r#_ge_from_lens
r-cCs"||}||kr|S|o ||kS)zFReturn a < b.  Computed by @total_ordering from (a <= b) and (a != b).)r,)r%r&r'r(r"r"r#_lt_from_leus
r.cCs||}||kr|S|S)z=Return a > b.  Computed by @total_ordering from (not a <= b).)r,)r%r&r'r(r"r"r#_gt_from_le|s
r/cCs$||}||kr|S|o"||kS)zIReturn a < b.  Computed by @total_ordering from (not a > b) and (a != b).)__gt__)r%r&r'r(r"r"r#_lt_from_gts
r1cCs||}|p||kS)zEReturn a >= b.  Computed by @total_ordering from (a > b) or (a == b).)r0)r%r&r'r(r"r"r#_ge_from_gts
r2cCs||}||kr|S|S)z=Return a <= b.  Computed by @total_ordering from (not a > b).)r0)r%r&r'r(r"r"r#_le_from_gts
r3cCs$||}||kr|S|p"||kS)zJReturn a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).)__ge__)r%r&r'r(r"r"r#_le_from_ges
r5cCs"||}||kr|S|o ||kS)zFReturn a > b.  Computed by @total_ordering from (a >= b) and (a != b).)r4)r%r&r'r(r"r"r#_gt_from_ges
r6cCs||}||kr|S|S)z=Return a < b.  Computed by @total_ordering from (not a >= b).)r4)r%r&r'r(r"r"r#_lt_from_ges
r7r0r,r4r$)r$r,r0r4csZfddtD}|stdt|}x.t|D]"\}}||kr0||_t||q0WS)z6Class decorator that fills in missing ordering methodscs(h|] }t|dtt|dk	r|qS)N)robject).0op)clsr"r#	<setcomp>sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)_convert
ValueErrormaxrr)r;rootsrootopnameopfuncr")r;r#rscsGfdddt}|S)z,Convert a cmp= function into a key= functioncsZeZdZdgZddZfddZfddZfdd	Zfd
dZfdd
Z	dZ
dS)zcmp_to_key.<locals>.KobjcSs
||_dS)N)rD)r%rDr"r"r#__init__szcmp_to_key.<locals>.K.__init__cs|j|jdkS)Nr)rD)r%r&)mycmpr"r#r$szcmp_to_key.<locals>.K.__lt__cs|j|jdkS)Nr)rD)r%r&)rFr"r#r0szcmp_to_key.<locals>.K.__gt__cs|j|jdkS)Nr)rD)r%r&)rFr"r#__eq__szcmp_to_key.<locals>.K.__eq__cs|j|jdkS)Nr)rD)r%r&)rFr"r#r,szcmp_to_key.<locals>.K.__le__cs|j|jdkS)Nr)rD)r%r&)rFr"r#r4szcmp_to_key.<locals>.K.__ge__N)rrr	__slots__rEr$r0rGr,r4__hash__r")rFr"r#KsrJ)r8)rFrJr")rFr#rs)rcsJeZdZdZdZfddZddZeddZd	d
Z	ddZ
ZS)
r	zSNew function with partial application of the given arguments
    and keywords.
    )funcargskeywordsr__weakref__cs|stdt|dkr td|^}}}t|s:tdt|}t|drv|j|}|j}|||}~|j	}t
t||}||_	||_||_|S)Nz1descriptor '__new__' of partial needs an argumentz*type 'partial' takes at least one argumentz#the first argument must be callablerK)
	TypeErrorlencallabletuplehasattrrLrMcopyrrKsuperr	__new__)rLrMr;rKZtmpkwr%)	__class__r"r#rWs(




zpartial.__new__cOs:|std|^}}|j}|||j|j||S)Nz2descriptor '__call__' of partial needs an argument)rPrMrUrrKrL)rLrMr%Znewkeywordsr"r"r#__call__
s

zpartial.__call__cCst|j}t|jg}|dd|jD|dd|jDt|jdkrld|dd	|dS|dd	|dS)	Ncss|]}t|VqdS)N)repr)r9xr"r"r#	<genexpr>sz#partial.__repr__.<locals>.<genexpr>css |]\}}|d|VqdS)=Nr")r9kvr"r"r#r\s	functoolsz
functools.(z, ))
typerrZrKextendrLrMitemsrjoin)r%qualnamerLr"r"r#__repr__s
zpartial.__repr__cCs*t||jf|j|j|jpd|jp$dffS)N)rcrKrLrMr)r%r"r"r#
__reduce__szpartial.__reduce__cCst|tstdt|dkr0tdt||\}}}}t|rrt|trr|dk	r`t|trr|dk	rzt|tsztdt|}|dkri}nt|tk	rt|}|dkri}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuplezexpected 4 items in state, got zinvalid partial state)
isinstancerSrPrQrRdictrcrrKrLrM)r%staterKrLkwds	namespacer"r"r#__setstate__ s(
zpartial.__setstate__)rrrrrHrWrYrrhrirp
__classcell__r"r")rXr#r	s
)r	c@s<eZdZdZddZddZddZdd	Zed
dZ	dS)
r
zMethod descriptor with partial application of the given arguments
    and keywords.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cOsnt|s t|ds td|t|trX|j|_|j||_|j	|_|j
|n||_||_||_dS)N__get__z${!r} is not callable or a descriptor)rRrTrPformatrkr
rKrLrMrUr)r%rKrLrMr"r"r#rEFs
zpartialmethod.__init__cCsNdtt|j}ddd|jD}d}|j|jj|jj	|j
||dS)Nz, css|]\}}d||VqdS)z{}={!r}N)rs)r9r^r_r"r"r#r\\sz)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))moduler;rKrLrM)rfmaprZrLrMrersrXrrrK)r%rLrM
format_stringr"r"r#rhZs

zpartialmethod.__repr__csfdd}j|_|_|S)Ncs<j}|||^}}|fjt|}j||S)N)rMrUrrLrSrK)rLrM
call_keywordscls_or_selfrest	call_args)r%r"r#_methodfs


z3partialmethod._make_unbound_method.<locals>._method)__isabstractmethod___partialmethod)r%r{r")r%r#_make_unbound_methodesz"partialmethod._make_unbound_methodcCst|jdd}d}|dk	rd|||}||jk	rdt|f|j|j}y|j|_Wntk
rbYnX|dkr||||}|S)Nrr)	rrKr	rLrM__self__rr~rr)r%rDr;getresultnew_funcr"r"r#rrps

zpartialmethod.__get__cCst|jddS)Nr|F)rrK)r%r"r"r#r|sz"partialmethod.__isabstractmethod__N)
rrrrrErhr~rrpropertyr|r"r"r"r#r
>s	CacheInfohitsmissesmaxsizecurrsizec@s(eZdZdZdZefddZddZdS)
_HashedSeqz This class guarantees that hash() will be called no more than once
        per element.  This is important because the lru_cache() will hash
        the key multiple times on a cache miss.

    	hashvaluecCs||dd<|||_dS)N)r)r%tuphashr"r"r#rEsz_HashedSeq.__init__cCs|jS)N)r)r%r"r"r#rIsz_HashedSeq.__hash__N)rrrrrHrrErIr"r"r"r#rsrc
s|}|r*||7}x|D]}	||	7}qW|rl||fdd|D7}|r||fdd|D7}n$||dkr|d|kr|dSt|S)aMake a cache key from optionally typed positional and keyword arguments

    The key is constructed in a way that is flat as possible rather than
    as a nested structure that would take more memory.

    If there is only a single argument and its data type is known to cache
    its hash value, then that argument is returned without a wrapper.  This
    saves space and improves lookup speed.

    c3s|]}|VqdS)Nr")r9r_)rcr"r#r\sz_make_key.<locals>.<genexpr>c3s|]}|VqdS)Nr")r9r_)rcr"r#r\sr)revaluesr)
rLrntypedkwd_mark	fasttypesrSrcrQkeyitemr")rcr#	_make_keys rFcs:ttrdkr(dndk	r(tdfdd}|S)aLeast-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    If *typed* is True, arguments of different types will be cached separately.
    For example, f(3.0) and f(3) will be treated as distinct calls with
    distinct results.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize)
    with f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used

    rNz)Expected maxsize to be an integer or Nonecst|t}t||S)N)_lru_cache_wrapper
_CacheInfor)
user_functionr)rrr"r#decorating_functionsz&lru_cache.<locals>.decorating_function)rkintrP)rrrr")rrr#rs
csttd\id	
djjt
gddgdd<dkrh
fdd}nNdkr	
fdd}n*	

fdd}	

fdd	}	

fd
d}||_||_|S)N)rrrOrFcsd7||}|S)Nrr")rLrnr)rrr"r#rs
z#_lru_cache_wrapper.<locals>.wrappercsH||}|}|k	r*d7|Sd7||}||<|S)Nrr")rLrnrr)cache	cache_getrmake_keyrsentinelrrr"r#rs

c	s2
||}	n|}|dk	rr|\}}}}||<||<
}||<
<||<
|<d7|Sd7WdQRX||}	|krnr
}	||	<||	<|	

}

}d
<
<|
=|	|<n6
}|
||g}||<
<|<kWdQRX|S)Nrr")rLrnrlink	link_prev	link_nextZ_keyrlastZoldrootZoldkeyZ	oldresult)KEYNEXTPREVRESULTrr	cache_lenfullrlockrrrrArrr"r#rsB

c	s SQRXdS)zReport cache statisticsNr"r")rrrrrrr"r#
cache_infoGsz&_lru_cache_wrapper.<locals>.cache_infoc	s<.ddgdd<ddWdQRXdS)z$Clear the cache and cache statisticsNrF)clearr")rrrrrrAr"r#cache_clearLs
z'_lru_cache_wrapper.<locals>.cache_clear)r8rr__len__rrr)rrrrrrrr")rrrrrrrrrrrrrrrArrrr#rs**9	r)rcCsg}xdd|D}|s|Sx:|D]2}|d}x$|D]}||ddkr4d}Pq4WPq"W|dkrhtd||x|D]}|d|krx|d=qxWqWdS)zMerges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    cSsg|]}|r|qSr"r")r9sr"r"r#
<listcomp>ksz_c3_merge.<locals>.<listcomp>rrNzInconsistent hierarchy)RuntimeErrorappend)	sequencesrs1	candidates2seqr"r"r#	_c3_mergecs$



rNc
s$x8tt|jD]"\}tdrt|j|}PqWd}rFtngt|jd|}g}t|j|d}x8D]0t|rxtfdd|jDsx|qxWx|D]	qWfdd|D}fdd|D}fd	d|D}	t
|gg|||	|g|g|gS)
aComputes the method resolution order using extended C3 linearization.

    If no *abcs* are given, the algorithm works exactly like the built-in C3
    linearization used for method resolution.

    If given, *abcs* is a list of abstract base classes that should be inserted
    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
    result. The algorithm inserts ABCs where their functionality is introduced,
    i.e. issubclass(cls, abc) returns True for the class itself but returns
    False for all its direct base classes. Implicit ABCs for a given class
    (either registered or inferred from the presence of a special method like
    __len__) are inserted directly after the last ABC explicitly listed in the
    MRO of said class. If two implicit ABCs end up next to each other in the
    resulting MRO, their ordering depends on the order of types in *abcs*.

    __abstractmethods__rNc3s|]}t|VqdS)N)
issubclass)r9b)baser"r#r\sz_c3_mro.<locals>.<genexpr>csg|]}t|dqS))abcs)_c3_mro)r9r)rr"r#rsz_c3_mro.<locals>.<listcomp>csg|]}t|dqS))r)r)r9r)rr"r#rscsg|]}t|dqS))r)r)r9r)rr"r#rs)	enumeratereversed	__bases__rTrQlistranyrremover)
r;riboundaryexplicit_basesabstract_basesother_basesexplicit_c3_mrosabstract_c3_mros
other_c3_mrosr")rrr#r~s(


rcstjfddfddDfddfddDtg}xD]}g}x<|D]0}|krlt|rl|fdd|jDqlW|s||qZ|jtd	d
x,|D]$}x|D]}||kr||qWqWqZWt|dS)zCalculates the method resolution order for a given class *cls*.

    Includes relevant abstract base classes (with their respective bases) from
    the *types* iterable. Uses a modified C3 linearization algorithm.

    cs|kot|dot|S)N__mro__)rTr)typ)basesr;r"r#
is_relatedsz _compose_mro.<locals>.is_relatedcsg|]}|r|qSr"r")r9n)rr"r#rsz _compose_mro.<locals>.<listcomp>cs(x"D]}||kr||jkrdSqWdS)NTF)r)rr&)typesr"r#is_strict_bases
z$_compose_mro.<locals>.is_strict_basecsg|]}|s|qSr"r")r9r)rr"r#rscsg|]}|kr|qSr"r")r9r)type_setr"r#rsT)rreverse)r)setr__subclasses__rrsortrQr)r;rmrorfoundsubsubclsr")rr;rrrrr#_compose_mros*




rcCsvt||}d}xX|D]P}|dk	r\||krZ||jkrZ||jkrZt||sZtd||P||kr|}qW||S)a^Returns the best matching implementation from *registry* for type *cls*.

    Where there is no registered implementation for a specific type, its method
    resolution order is used to find a more generic implementation.

    Note: if *registry* does not contain an implementation for the base
    *object* type, this function may return None.

    NzAmbiguous dispatch: {} or {})rkeysrrrrsr)r;registryrmatchtr"r"r#
_find_impls




rcsddl}ddl}i|dfdddfdd	fdd}t|d	d
|t<|_|_||_j	|_
t|||S)akSingle-dispatch generic function decorator.

    Transforms a function into a generic function, which can have different
    behaviours depending upon the type of its first argument. The decorated
    function acts as the default implementation, and additional
    implementations can be registered using the register() attribute of the
    generic function.
    rNcs|dk	r"t}|kr"|y|}WnHtk
rvy|}Wntk
rht|}YnX||<YnX|S)zgeneric_func.dispatch(cls) -> <function implementation>

        Runs the dispatch algorithm to return the best available implementation
        for the given *cls* registered on *generic_func*.

        N)r
rKeyErrorr)r;
current_tokenimpl)cache_tokendispatch_cacherr"r#dispatchsz singledispatch.<locals>.dispatchcs|dkrttr fddStdi}|s@tdd}ddlm}tt||\}ttst	d	|d
d|<dkrt
drt|S)
zgeneric_func.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_func*.

        Ncs
|S)Nr")f)r;registerr"r#<lambda> z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)get_type_hintszInvalid annotation for z. z is not a class.r)
rkrcrrPtypingrnextiterreAssertionErrorrTr
r)r;rKannrargname)rrrr)r;r#rs"
z singledispatch.<locals>.registercs&|std|dj||S)Nz( requires at least 1 positional argumentr)rPrX)rLkw)rfuncnamer"r#r6szsingledispatch.<locals>.wrapperrzsingledispatch function)N)rweakrefWeakKeyDictionaryrr8rrMappingProxyTyperr_clear_cacher)rKrrrr")rrrrrrr#rs
)rF)N)4r__all__
_functoolsrImportErrorabcr
collectionsrreprlibr_threadrrrrrr'r)r*r+r-r.r/r1r2r3r5r6r7r=rrr	r8r
rrrrstrrSrcrQrrrrrrrrr"r"r"r#<module>s


NN
(t
-)