AlkantarClanX12

Your IP : 3.133.107.11


Current Path : /opt/alt/python37/lib64/python3.7/concurrent/futures/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/concurrent/futures/__pycache__/_base.cpython-37.opt-2.pyc

B

YI~dBU�
@s`dZddlZddlZddlZddlZdZdZdZdZdZ	dZ
d	Zd
ZdZ
e	e
eee
gZe	de
d
edede
diZe�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�Zd!d"�Zd#d$�Zd1d%d&�Ze�d'd(�Z defd)d*�Z!Gd+d,�d,e�Z"Gd-d.�d.e�Z#Gd/d0�d0e$�Z%dS)2z"Brian Quinlan (brian@sweetapp.com)�N�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�
_AS_COMPLETED�PENDING�RUNNING�	CANCELLED�CANCELLED_AND_NOTIFIED�FINISHED�pending�running�	cancelled�finishedzconcurrent.futuresc@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�=/opt/alt/python37/lib64/python3.7/concurrent/futures/_base.pyr,src@seZdZdS)�CancelledErrorN)rrrrrrrr0src@seZdZdS)�TimeoutErrorN)rrrrrrrr4src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_WaitercCst��|_g|_dS)N)�	threadingZEvent�event�finished_futures)�selfrrr�__init__:s
z_Waiter.__init__cCs|j�|�dS)N)r�append)r�futurerrr�
add_result>sz_Waiter.add_resultcCs|j�|�dS)N)rr)rrrrr�
add_exceptionAsz_Waiter.add_exceptioncCs|j�|�dS)N)rr)rrrrr�
add_cancelledDsz_Waiter.add_cancelledN)rrrrrr r!rrrrr8srcs@eZdZ�fdd�Z�fdd�Z�fdd�Z�fdd�Z�ZS)	�_AsCompletedWaitercstt|���t��|_dS)N)�superr"rr�Lock�lock)r)�	__class__rrrJsz_AsCompletedWaiter.__init__c	s0|j� tt|��|�|j��WdQRXdS)N)r%r#r"rr�set)rr)r&rrrNsz_AsCompletedWaiter.add_resultc	s0|j� tt|��|�|j��WdQRXdS)N)r%r#r"r rr')rr)r&rrr Ssz _AsCompletedWaiter.add_exceptionc	s0|j� tt|��|�|j��WdQRXdS)N)r%r#r"r!rr')rr)r&rrr!Xsz _AsCompletedWaiter.add_cancelled)rrrrrr r!�
__classcell__rr)r&rr"Gsr"cs4eZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�_FirstCompletedWaitercst��|�|j��dS)N)r#rrr')rr)r&rrr`sz _FirstCompletedWaiter.add_resultcst��|�|j��dS)N)r#r rr')rr)r&rrr dsz#_FirstCompletedWaiter.add_exceptioncst��|�|j��dS)N)r#r!rr')rr)r&rrr!hsz#_FirstCompletedWaiter.add_cancelled)rrrrr r!r(rr)r&rr)]sr)csHeZdZ�fdd�Zdd�Z�fdd�Z�fdd�Z�fd	d
�Z�ZS)�_AllCompletedWaitercs$||_||_t��|_t���dS)N)�num_pending_calls�stop_on_exceptionrr$r%r#r)rr+r,)r&rrros
z_AllCompletedWaiter.__init__c	Cs4|j�$|jd8_|js&|j��WdQRXdS)N�)r%r+rr')rrrr�_decrement_pending_callsusz,_AllCompletedWaiter._decrement_pending_callscst��|�|��dS)N)r#rr.)rr)r&rrr{sz_AllCompletedWaiter.add_resultcs*t��|�|jr|j��n|��dS)N)r#r r,rr'r.)rr)r&rrr sz!_AllCompletedWaiter.add_exceptioncst��|�|��dS)N)r#r!r.)rr)r&rrr!�sz!_AllCompletedWaiter.add_cancelled)	rrrrr.rr r!r(rr)r&rr*ls
r*c@s$eZdZdd�Zdd�Zdd�ZdS)�_AcquireFuturescCst|td�|_dS)N)�key)�sorted�id�futures)rr3rrrr�sz_AcquireFutures.__init__cCsx|jD]}|j��qWdS)N)r3�
_condition�acquire)rrrrr�	__enter__�sz_AcquireFutures.__enter__cGsx|jD]}|j��qWdS)N)r3r4�release)r�argsrrrr�__exit__�sz_AcquireFutures.__exit__N)rrrrr6r9rrrrr/�sr/cCs�|tkrt�}nZ|tkr t�}nJtdd�|D��}|tkrHt|dd�}n"|tkr^t|dd�}ntd|��x|D]}|j	�
|�qpW|S)Ncss|]}|jttgkVqdS)N)�_stater	r
)�.0�frrr�	<genexpr>�sz._create_and_install_waiters.<locals>.<genexpr>T)r,FzInvalid return condition: %r)rr"rr)�sumrr*r�
ValueError�_waitersr)�fs�return_when�waiterZ
pending_countr<rrr�_create_and_install_waiters�s
rDc	csXxR|rR|d}x|D]}|�|�qW|j�|j�|�WdQRX~|��VqWdS)N���)�remover4r@�pop)rArC�ref_collectr<Zfutures_setrrr�_yield_finished_futures�s
rIc	csJ|dk	r|t��}t|�}t|�}t|��*tdd�|D��}||}t|t�}WdQRXt|�}z�t|||fd�EdHx�|�r|dkr�d}n(|t��}|dkr�t	dt|�|f��|j
�|�|j�|j
}g|_
|j
��WdQRX|��t||||fd�EdHq~WWdx,|D]$}|j�|j�|�WdQRX�qWXdS)Ncss |]}|jttgkr|VqdS)N)r:r	r
)r;r<rrrr=�szas_completed.<locals>.<genexpr>)rHrz%d (of %d) futures unfinished)�time�	monotonicr'�lenr/rDr�listrIrr�waitr%r�clear�reverser4r@rF)	rA�timeout�end_timeZ
total_futuresrrrCZwait_timeoutr<rrr�as_completed�s@

rS�DoneAndNotDoneFuturesz
done not_donec
Cs�t|���tdd�|D��}t|�|}|tkr>|r>t||�S|tkrf|rftdd�|D��rft||�St|�t|�kr�t||�St||�}WdQRX|j�	|�x*|D]"}|j
�|j�|�WdQRXq�W|�
|j�t|t|�|�S)Ncss |]}|jttgkr|VqdS)N)r:r	r
)r;r<rrrr=szwait.<locals>.<genexpr>css&|]}|��s|��dk	r|VqdS)N)r
�	exception)r;r<rrrr=$s)r/r'rrTr�anyrLrDrrNr4r@rF�updater)rArQrB�doneZnot_donerCr<rrrrNs"




rNc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zddd�Zddd�Z
dd�Zdd�Zdd�ZdS) �FuturecCs,t��|_t|_d|_d|_g|_g|_dS)N)	rZ	Conditionr4rr:�_result�
_exceptionr@�_done_callbacks)rrrrr8s
zFuture.__init__c	CsBx<|jD]2}y||�Wqtk
r8t�d|�YqXqWdS)Nz!exception calling callback for %r)r\�	Exception�LOGGERrU)r�callbackrrr�_invoke_callbacksAs
zFuture._invoke_callbacksc	Cs�|j�v|jtkr`|jr<d|jjt|�t|j|jjjfSd|jjt|�t|j|jjjfSd|jjt|�t|jfSQRXdS)Nz<%s at %#x state=%s raised %s>z <%s at %#x state=%s returned %s>z<%s at %#x state=%s>)	r4r:r
r[r&rr2�_STATE_TO_DESCRIPTION_MAPrZ)rrrr�__repr__Hs"
zFuture.__repr__c	CsR|j�:|jttgkrdS|jttgkr,dSt|_|j��WdQRX|��dS)NFT)r4r:rr
rr	�
notify_allr`)rrrr�cancel\sz
Future.cancelc	Cs |j�|jttgkSQRXdS)N)r4r:rr	)rrrrr
oszFuture.cancelledc	Cs|j�|jtkSQRXdS)N)r4r:r)rrrrrtszFuture.runningc	Cs"|j�|jtttgkSQRXdS)N)r4r:rr	r
)rrrrrXyszFuture.donecCs|jr|j�n|jSdS)N)r[rZ)rrrrZ__get_result~szFuture.__get_resultc	Csd|j�&|jtttgkr(|j�|�dSWdQRXy||�Wn tk
r^t�	d|�YnXdS)Nz!exception calling callback for %r)
r4r:rr	r
r\rr]r^rU)r�fnrrr�add_done_callback�szFuture.add_done_callbackNc	Csx|j�h|jttgkrt��n|jtkr0|��S|j�|�|jttgkrRt��n|jtkrd|��St��WdQRXdS)N)	r4r:rr	rr
�_Future__get_resultrNr)rrQrrr�result�s

z
Future.resultc	Cst|j�d|jttgkrt��n|jtkr.|jS|j�|�|jttgkrPt��n|jtkr`|jSt��WdQRXdS)N)	r4r:rr	rr
r[rNr)rrQrrrrU�s

zFuture.exceptionc	Cst|j�d|jtkr6t|_x|jD]}|�|�q WdS|jtkrJt|_dSt�	dt
|�|j�td��WdQRXdS)NFTz!Future %s in unexpected state: %szFuture in unexpected state)r4r:rr	r@r!rrr^Zcriticalr2�RuntimeError)rrCrrr�set_running_or_notify_cancel�s

z#Future.set_running_or_notify_cancelc	CsN|j�6||_t|_x|jD]}|�|�qW|j��WdQRX|��dS)N)r4rZr
r:r@rrcr`)rrhrCrrr�
set_resultszFuture.set_resultc	CsN|j�6||_t|_x|jD]}|�|�qW|j��WdQRX|��dS)N)r4r[r
r:r@r rcr`)rrUrCrrr�
set_exceptionszFuture.set_exception)N)N)rrrrr`rbrdr
rrXrgrfrhrUrjrkrlrrrrrY5s	

"(
rYc@s>eZdZdd�Zddd�dd�Zdd	d
�Zdd�Zd
d�ZdS)�ExecutorcOsBt|�dkrn*|std��nd|kr8tdt|�d��t��dS)N�z:descriptor 'submit' of 'Executor' object needs an argumentrez6submit expected at least 1 positional argument, got %dr-)rL�	TypeError�NotImplementedError)r8�kwargsrrr�submits	
zExecutor.submitNr-)rQ�	chunksizecsB�dk	r�t�����fdd�t|�D�����fdd�}|�S)Ncsg|]}�j�f|���qSr)rr)r;r8)rerrr�
<listcomp>Ksz Executor.map.<locals>.<listcomp>c	3sdzF���x8�rB�dkr(�����Vq�����t���VqWWdx�D]}|��qNWXdS)N)rPrGrhrJrKrd)r)rRrArQrr�result_iteratorOs 
z%Executor.map.<locals>.result_iterator)rJrK�zip)rrerQrs�	iterablesrur)rRrerArrQr�map2s

zExecutor.mapTcCsdS)Nr)rrNrrr�shutdown^szExecutor.shutdowncCs|S)Nr)rrrrr6kszExecutor.__enter__cCs|jdd�dS)NT)rNF)ry)r�exc_typeZexc_valZexc_tbrrrr9nszExecutor.__exit__)T)rrrrrrxryr6r9rrrrrms
,

rmc@seZdZdS)�BrokenExecutorN)rrrrrrrr{ssr{)N)&�
__author__�collectionsZloggingrrJrrrrrrrr	r
Z_FUTURE_STATESraZ	getLoggerr^r]rrr�objectrr"r)r*r/rDrIrS�
namedtuplerTrNrYrmrir{rrrr�<module>sT

>1gX