ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/functools.cpython-37.opt-2.pyc

B

0��c���@s�dddddddddd	d
gZyddlmZWnek
r>YnXdd
lmZddlmZddlm	Z	ddl
mZdZdZ
ee
fdd�Zee
fdd�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd �Zefd!d"�Zefd#d$�Zefd%d&�Zefd'd(�Zefd)d*�Zefd+d,�Zd-efd.efd/efgd/efd0efd-efgd0efd/efd.efgd.efd-efd0efgd1�Zd2d�Zd3d�Zydd4lmZWnek
�r�YnXGd5d�d�Z ydd6lm Z Wnek
�r�YnXGd7d	�d	e!�Z"ed8d9d:d;d<g�Z#Gd=d>�d>e$�Z%e!�fe&e'he(e)e*fd?d@�Z+dQdCd�Z,dDdE�Z-yddFlm-Z-Wnek
�rnYnXdGdH�Z.dRdJdK�Z/dLdM�Z0dNdO�Z1dPd
�Z2dIS)S�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�)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||i��qDW||_|S)N)�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r"�./opt/alt/python37/lib64/python3.7/functools.pyr%s

cCstt|||d�S)N)rrr)r	r)rrrr"r"r#rCscCs$|�|�}||kr|S|o"||kS)N)�__lt__)�self�other�NotImplemented�	op_resultr"r"r#�_gt_from_lt[s
r)cCs|�|�}|p||kS)N)r$)r%r&r'r(r"r"r#�_le_from_ltbs
r*cCs|�|�}||kr|S|S)N)r$)r%r&r'r(r"r"r#�_ge_from_ltgs
r+cCs$|�|�}||kr|S|p"||kS)N)�__le__)r%r&r'r(r"r"r#�_ge_from_lens
r-cCs"|�|�}||kr|S|o ||kS)N)r,)r%r&r'r(r"r"r#�_lt_from_leus
r.cCs|�|�}||kr|S|S)N)r,)r%r&r'r(r"r"r#�_gt_from_le|s
r/cCs$|�|�}||kr|S|o"||kS)N)�__gt__)r%r&r'r(r"r"r#�_lt_from_gt�s
r1cCs|�|�}|p||kS)N)r0)r%r&r'r(r"r"r#�_ge_from_gt�s
r2cCs|�|�}||kr|S|S)N)r0)r%r&r'r(r"r"r#�_le_from_gt�s
r3cCs$|�|�}||kr|S|p"||kS)N)�__ge__)r%r&r'r(r"r"r#�_le_from_ge�s
r5cCs"|�|�}||kr|S|o ||kS)N)r4)r%r&r'r(r"r"r#�_gt_from_ge�s
r6cCs|�|�}||kr|S|S)N)r4)r%r&r'r(r"r"r#�_lt_from_ge�s
r7r0r,r4r$)r$r,r0r4csZ�fdd�tD�}|std��t|�}x.t|D]"\}}||kr0||_t�||�q0W�S)Ncs(h|] }t�|d�tt|d�k	r|�qS)N)r�object)�.0�op)�clsr"r#�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)r;�roots�root�opname�opfuncr")r;r#r�scsG�fdd�dt�}|S)NcsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dS)N)rD)r%rDr"r"r#�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS)Nr)rD)r%r&)�mycmpr"r#r$�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkS)Nr)rD)r%r&)rFr"r#r0�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkS)Nr)rD)r%r&)rFr"r#�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkS)Nr)rD)r%r&)rFr"r#r,�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkS)Nr)rD)r%r&)rFr"r#r4�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rEr$r0rGr,r4�__hash__r")rFr"r#�K�srJ)r8)rFrJr")rFr#r�s)rcsFeZdZdZ�fdd�Zdd�Ze�dd��Zdd	�Zd
d�Z	�Z
S)r	)�func�args�keywordsr�__weakref__cs�|std��t|�dkr td��|^}}}t|�s:td��t|�}t|d�rv|j|}|j��}|�|�|}~|j	}t
t|��|�}||_	||_||_|S)Nz1descriptor '__new__' of partial needs an argument�z*type 'partial' takes at least one argumentz#the first argument must be callablerK)
�	TypeError�len�callable�tuple�hasattrrLrM�copyrrK�superr	�__new__)rLrMr;rKZtmpkwr%)�	__class__r"r#rW�s(




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__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdS)N)�repr)r9�xr"r"r#�	<genexpr>sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr")r9�k�vr"r"r#r\s�	functoolsz
functools.�(z, �))
�typerrZrK�extendrLrM�itemsr�join)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__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstancerSrPrQrR�dictrcrrKrLrM)r%�staterKrL�kwds�	namespacer"r"r#�__setstate__ s(
zpartial.__setstate__)rrrrHrWrYrrhrirp�
__classcell__r"r")rXr#r	�s
)r	c@s8eZdZdd�Zdd�Zdd�Zdd�Zed	d
��ZdS)r
cOs�t|�dkr|^}}}n>|s&td��n0d|krB|�d�}|^}}ntdt|�d��t|�}t|�s~t|d�s~td�|���t|t�r�|j	|_	|j
||_
|j��|_|j�
|�n||_	||_
||_dS)NrOz8descriptor '__init__' of partialmethod needs an argumentrKz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)rQrP�poprSrRrT�formatrkr
rKrLrMrUr)rLrMr%rKr"r"r#rEFs*



zpartialmethod.__init__cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nz, css|]\}}d�||�VqdS)z{}={!r}N)ru)r9r^r_r"r"r#r\isz)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�moduler;rKrLrM)rf�maprZrLrMrerurXrrrK)r%rLrM�
format_stringr"r"r#rhgs

zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs<�j��}|�|�|^}}|f�jt|�}�j||�S)N)rMrUrrLrSrK)rLrM�
call_keywords�cls_or_self�rest�	call_args)r%r"r#�_methodss


z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r%r}r")r%r#�_make_unbound_methodrsz"partialmethod._make_unbound_methodcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}y|j|_Wntk
rbYnX|dkr||���||�}|S)Nrs)	rrKr	rLrM�__self__rr�rs)r%rDr;�get�result�new_funcr"r"r#rs}s

zpartialmethod.__get__cCst|jdd�S)Nr~F)rrK)r%r"r"r#r~�sz"partialmethod.__isabstractmethod__N)	rrrrErhr�rs�propertyr~r"r"r"r#r
>s
!�	CacheInfo�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dS)N)r�)r%�tup�hashr"r"r#rE�sz_HashedSeq.__init__cCs|jS)N)r�)r%r"r"r#rI�sz_HashedSeq.__hash__N)rrrrHr�rErIr"r"r"r#r��sr�c
s�|}|r*||7}x|��D]}	||	7}qW|rl||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)Nc3s|]}�|�VqdS)Nr")r9r_)rcr"r#r\�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdS)Nr")r9r_)rcr"r#r\�srrr)re�valuesr�)
rLrn�typed�kwd_mark�	fasttypesrSrcrQ�key�itemr")rcr#�	_make_key�s r��Fcs:t�t�r�dkr(d�n�dk	r(td����fdd�}|S)Nrz)Expected maxsize to be an integer or Nonecst|��t�}t||�S)N)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr)r�r�r"r#�decorating_function�sz&lru_cache.<locals>.decorating_function)rk�intrP)r�r�r�r")r�r�r#r�s
cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rrrrO�rFcs�d7��||�}|S)Nrrr")rLrnr�)r�r�r"r#rs
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|S)Nrrr")rLrnr�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r"r#rs

c	s2�
||��}�	�n�|�}|dk	rr|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|S�d7�WdQRX�||�}�	��|�kr�n��r�
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�WdQRX|S)Nrrr")rLrnr��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rAr�r�r"r#rsB

c	s ���������SQRXdS)Nr"r")r�r�r�r�r�r�r"r#�
cache_infoTsz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�WdQRXdS)NrF)�clearr")r�r�r�r�r�rAr"r#�cache_clearYs
z'_lru_cache_wrapper.<locals>.cache_clear)r8r�r��__len__rr�r�)r�r�r�r�rr�r�r")r�r�r�r�r�r�r�r�r�r�r�r�r�r�rAr�r�r�r#r��s**9	r�)r�cCs�g}x�dd�|D�}|s|Sx:|D]2}|d}x$|D]}||dd�kr4d}Pq4WPq"W|dkrhtd��|�|�x|D]}|d|krx|d=qxWqWdS)NcSsg|]}|r|�qSr"r")r9�sr"r"r#�
<listcomp>xsz_c3_merge.<locals>.<listcomp>rrrzInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr"r"r#�	_c3_mergeps$



r�Nc
s$x8tt|j��D]"\}�t�d�rt|j�|}PqWd}�rFt��ng�t|jd|��}g}t|j|d��}x8�D]0�t|��rxt�fdd�|jD��sx|���qxWx|D]���	��q�W�fdd�|D�}�fdd�|D�}�fdd�|D�}	t
|gg|||	|g|g|g�S)	N�__abstractmethods__rc3s|]}t|��VqdS)N)�
issubclass)r9�b)�baser"r#r\�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS))�abcs)�_c3_mro)r9r�)r�r"r#r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qS))r�)r�)r9r�)r�r"r#r��scsg|]}t|�d��qS))r�)r�)r9r�)r�r"r#r��s)�	enumerate�reversed�	__bases__rTrQ�listr��anyr��remover�)
r;r��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr")r�r�r#r��s(


r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}x��D]�}g}x<|��D]0}|�krlt�|�rl|��fdd�|jD��qlW|s�|�|�qZ|jtd	d
�x,|D]$}x|D]}||kr�|�|�q�Wq�WqZWt�|d�S)Ncs|�kot|d�ot�|�S)N�__mro__)rTr�)�typ)�basesr;r"r#�
is_related�sz _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr"r")r9�n)r�r"r#r��sz _compose_mro.<locals>.<listcomp>cs(x"�D]}||kr||jkrdSqWdS)NTF)r�)r�r&)�typesr"r#�is_strict_base�s
z$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr"r")r9r�)r�r"r#r��scsg|]}|�kr|�qSr"r")r9r�)�type_setr"r#r��sT)r��reverse)r�)�setr��__subclasses__r�r��sortrQr�)r;r��mror��found�sub�subclsr")r�r;r�r�r�r�r#�_compose_mro�s*




r�cCsvt||���}d}xX|D]P}|dk	r\||krZ||jkrZ||jkrZt||�sZtd�||���P||kr|}qW|�|�S)NzAmbiguous dispatch: {} or {})r��keysr�r�r�rur�)r;�registryr��match�tr"r"r#�
_find_impl�s




r�cs�ddl}ddl}i�|���d����fdd��d
����fdd�	���fdd�}t|dd	��|�t<�|_�|_|���|_�j	|_
t||�|S)Nrcs|�dk	r"t�}�|kr"���|�y�|}WnHtk
rvy�|}Wntk
rht|��}YnX|�|<YnX|S)N)r
r��KeyErrorr�)r;�
current_token�impl)�cache_token�dispatch_cacher�r"r#�dispatch
sz singledispatch.<locals>.dispatchcs�|dkrht�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�|��<�dkr�t	�d�r�t
�����|S)	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_hintsr�)rkrcrrP�typingr��next�iterrerTr
r�)r;rK�annr��argname)r�r�r�r�)r;r#r�$s
z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)rPrX)rL�kw)r��funcnamer"r#rCszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrr8r�r��MappingProxyTyper�r��_clear_cacher)rKr�r�rr")r�r�r�r�r�r�r#r�s
)r�F)N)3�__all__�
_functoolsr�ImportError�abcr
�collectionsr�reprlibr�_threadrrrrrr'r)r*r+r-r.r/r1r2r3r5r6r7r=rrr	r8r
r�r�r�r��strrSrcrQr�rr�r�r�r�r�rr"r"r"r#�<module>s�

N[
(t
-)

Zerion Mini Shell 1.0