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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /usr/lib64/python3.6/asyncio/__pycache__
Viewing File: /usr/lib64/python3.6/asyncio/__pycache__/tasks.cpython-36.pyc
3 \�a� @s�dZddddddddd d d d d g ZddlZddlZddlZddlZddlZddlm Z ddlm Z ddlm Z ddlm Z ddlm Z ddl mZGdd�de j�ZeZy ddlZWnek r�Yn XejZZej jZej jZej jZedded�dd��Zdd�Zedd�dd��Zedd��Zddd �d!d�Zed/dd�d"d��Zdd�d#d$�Zee�d <d e_ [dd�d%d �Z!ed&d'��Z"Gd(d)�d)e j�Z#dd*d+�d,d �Z$dd�d-d �Z%d.d �Z&dS)0z0Support for tasks, coroutines and the scheduler.�Task�FIRST_COMPLETED�FIRST_EXCEPTION� ALL_COMPLETED�wait�wait_for� as_completed�sleep�async�gather�shield� ensure_future�run_coroutine_threadsafe�N�)� base_tasks)�compat)� coroutines)�events)�futures)� coroutinecs�eZdZdZej�ZiZdZe ddd��Z e ddd��Z dd��fd d � Z e jrXd d �Zd d�Zdd�dd�Zddd�dd�Zdd�Zd�fdd� Zdd�Z�ZS)rz A coroutine wrapped in a Future.TNcCs|dkrtj�}|jj|�S)z�Return the currently running task in an event loop or None. By default the current task for the current event loop is returned. None is returned when called not in the context of a Task. N)r�get_event_loop�_current_tasks�get)�cls�loop�r�/usr/lib64/python3.6/tasks.py� current_task.szTask.current_taskcs$�dkrtj���fdd�|jD�S)z|Return a set of all tasks for an event loop. By default all tasks for the current event loop are returned. Ncsh|]}|j�kr|�qSr)�_loop)�.0�t)rrr� <setcomp>Bsz!Task.all_tasks.<locals>.<setcomp>)rr� _all_tasks)rrr)rr� all_tasks:szTask.all_tasks)rcsdtj|�stt|���t�j|d�|jr2|jd=||_d|_d|_ |j j |j �|j jj|�dS)N)rrF���)r� iscoroutine�AssertionError�repr�super�__init__�_source_traceback�_coro� _fut_waiter� _must_cancelr� call_soon�_step� __class__r"�add)�self�coror)r0rrr)Dsz Task.__init__cCsH|jtjkr8|jr8|dd�}|jr,|j|d<|jj|�tjj|�dS)Nz%Task was destroyed but it is pending!)�task�messageZsource_traceback) Z_staterZ_PENDING�_log_destroy_pendingr*rZcall_exception_handler�Future�__del__)r2�contextrrrr8Ss  z Task.__del__cCs tj|�S)N)rZ_task_repr_info)r2rrr� _repr_info^szTask._repr_info)�limitcCs tj||�S)a�Return the list of stack frames for this task's coroutine. If the coroutine is not done, this returns the stack where it is suspended. If the coroutine has completed successfully or was cancelled, this returns an empty list. If the coroutine was terminated by an exception, this returns the list of traceback frames. The frames are always ordered from oldest to newest. The optional limit gives the maximum number of frames to return; by default all available frames are returned. Its meaning differs depending on whether a stack or a traceback is returned: the newest frames of a stack are returned, but the oldest frames of a traceback are returned. (This matches the behavior of the traceback module.) For reasons beyond our control, only one stack frame is returned for a suspended coroutine. )rZ_task_get_stack)r2r;rrr� get_stackaszTask.get_stack)r;�filecCstj|||�S)anPrint the stack or traceback for this task's coroutine. This produces output similar to that of the traceback module, for the frames retrieved by get_stack(). The limit argument is passed to get_stack(). The file argument is an I/O stream to which the output is written; by default output is written to sys.stderr. )rZ_task_print_stack)r2r;r=rrr� print_stackxs zTask.print_stackcCs4d|_|j�rdS|jdk r*|jj�r*dSd|_dS)a�Request that this task cancel itself. This arranges for a CancelledError to be thrown into the wrapped coroutine on the next cycle through the event loop. The coroutine then has a chance to clean up or even deny the request using try/except/finally. Unlike Future.cancel, this does not guarantee that the task will be cancelled: the exception might be caught and acted upon, delaying cancellation of the task or preventing cancellation completely. The task may also return a value or raise a different exception. Immediately after this method is called, Task.cancelled() will not return True (unless the task was already cancelled). A task will be marked as cancelled when the wrapped coroutine terminates with a CancelledError exception (even if cancel() was not called). FNT)Z_log_traceback�doner,�cancelr-)r2rrrr@�s  z Task.cancelcs�|j� stdj||���|jr:t|tj�s4tj�}d|_|j}d|_||j j |j <�zy"|dkrn|j d�}n |j |�}Wn�tk r�}z.|jr�d|_|jtj��n |j|j�WYdd}~X�n�tjk r�t�j�Y�n~tk �r}z|j|�WYdd}~X�nPtk �rD}z|j|��WYdd}~X�n Xt|dd�}|dk �r|j |j k �r�|j j|jtdj||���n||�r�||k�r�|j j|jtdj|���n2d|_|j|j�||_|j�r|jj��rd|_n|j j|jtdj||���n^|dk�r |j j|j�nDtj|��rJ|j j|jtdj||���n|j j|jtdj|���Wd|j j j|j �d}XdS) Nz!_step(): already done: {!r}, {!r}F�_asyncio_future_blockingz6Task {!r} got Future {!r} attached to a different loopz!Task cannot await on itself: {!r}z;yield was used instead of yield from in task {!r} with {!r}zIyield was used instead of yield from for generator in task {!r} with {!r}zTask got bad yield: {!r}) r?r&�formatr-� isinstancer�CancelledErrorr+r,r0rr�send�throw� StopIteration� set_exception� set_result�valuer(r@� Exception� BaseException�getattrr.r/� RuntimeErrorrA�add_done_callback�_wakeup�inspectZ isgenerator�pop)r2�excr3�resultZblocking)r0rrr/�s�            z Task._stepcCsJy |j�Wn,tk r8}z|j|�WYdd}~Xn X|j�d}dS)N)rTrKr/)r2�futurerSrrrrP�s  z Task._wakeup)N)N)N)�__name__� __module__� __qualname__�__doc__�weakref�WeakSetr"rr6� classmethodrr#r)rZPY34r8r:r<r>r@r/rP� __classcell__rr)r0rrs"     !T)r�timeout� return_whenc#s�tj|�stj|�r&tdt|�j��|s2td��|tt t fkrNtdj |����dkr^t j ���fdd�t|�D�}t|||��EdHS)a�Wait for the Futures and coroutines given by fs to complete. The sequence futures must not be empty. Coroutines will be wrapped in Tasks. Returns two sets of Future: (done, pending). Usage: done, pending = yield from asyncio.wait(fs) Note: This does not raise TimeoutError! Futures that aren't done when the timeout occurs are returned in the second set. z expect a list of futures, not %sz#Set of coroutines/Futures is empty.zInvalid return_when value: {}Ncsh|]}t|�d��qS))r)r )r�f)rrrr!7szwait.<locals>.<setcomp>)r�isfuturerr%� TypeError�typerV� ValueErrorrrrrBrr�set�_wait)�fsrr^r_r)rrrscGs|j�s|jd�dS)N)r?rI)�waiter�argsrrr�_release_waiter<srj)rccs�|dkrtj�}|dkr"|EdHS|j�}|j|t|�}tjt|�}t||d�}|j|�zhy|EdHWn*t j k r�|j |�|j ��YnX|j �r�|j�S|j |�|j �t j��Wd|j �XdS)a�Wait for the single Future or coroutine to complete, with timeout. Coroutine will be wrapped in Task. Returns result of the Future or coroutine. When a timeout occurs, it cancels the task and raises TimeoutError. To avoid the task cancellation, wrap it in shield(). If the wait is cancelled, the task is also cancelled. This function is a coroutine. N)r)rr� create_future� call_laterrj� functools�partialr rOrrD�remove_done_callbackr@r?rT� TimeoutError)�futr^rrh�timeout_handle�cbrrrrAs,       c #s�|s td��|j��d�|dk r.|j|t���t|������fdd�}x|D]}|j|�qNWz�EdHWd�dk r��j�Xt�t�}}x4|D],}|j|�|j �r�|j |�q�|j |�q�W||fS)zeInternal helper for wait() and wait_for(). The fs argument must be a collection of Futures. zSet of Futures is empty.Ncs\�d8��dks6�tks6�tkrX|j� rX|j�dk rX�dk rF�j��j�sX�jd�dS)Nrr)rr� cancelled� exceptionr@r?rI)r`)�counterr_rrrhrr�_on_completion|s z_wait.<locals>._on_completion) r&rkrlrj�lenrOr@reror?r1)rgr^r_rrwr`r?�pendingr)rvr_rrrhrrfos(      rf)rr^c#s�tj|�stj|�r&tdt|�j���dk r2�ntj���fdd�t |�D��ddl m }|�d��d����fdd �}���fd d ��t �fd d ��}x�D]}|j ��q�W�r�|dk rʈj||��xtt���D] }|�Vq�WdS)amReturn an iterator whose values are coroutines. When waiting for the yielded coroutines you'll get the results (or exceptions!) of the original Futures (or coroutines), in the order in which and as soon as they complete. This differs from PEP 3148; the proper way to use this is: for f in as_completed(fs): result = yield from f # The 'yield from' may raise. # Use result. If a timeout is specified, the 'yield from' will raise TimeoutError when the timeout occurs before all Futures are done. Note: The futures 'f' are not necessarily members of fs. z expect a list of futures, not %sNcsh|]}t|�d��qS))r)r )rr`)rrrr!�szas_completed.<locals>.<setcomp>r)�Queue)rcs.x �D]}|j���jd�qW�j�dS)N)ro� put_nowait�clear)r`)rwr?�todorr� _on_timeout�s  z!as_completed.<locals>._on_timeoutcs6�sdS�j|��j|�� r2�dk r2�j�dS)N)�remover{r@)r`)r?rrr}rrrw�s   z$as_completed.<locals>._on_completionc3s$�j�EdH}|dkrtj�|j�S)N)rrrprT)r`)r?rr� _wait_for_one�sz#as_completed.<locals>._wait_for_one)rrarr%rbrcrVrrreZqueuesrzrrOrl�rangerx)rgrr^rzr~r�r`�_r)rwr?rrrr}rr�s      c csX|dkrdV|S|dkr"tj�}|j�}|jj|tj||�}z |EdHS|j�XdS)z9Coroutine that completes after a given time (in seconds).rN)rrrkrrlrZ_set_result_unless_cancelledr@)ZdelayrTrrU�hrrrr�s cCstjdtdd�t||d�S)z�Wrap a coroutine in a future. If the argument is a Future, it is returned directly. This function is deprecated in 3.5. Use asyncio.ensure_future() instead. z;asyncio.async() function is deprecated, use ensure_future()�)� stacklevel)r)�warnings�warn�DeprecationWarningr )�coro_or_futurerrrr�async_�sr�cCs�tj|�r(|dk r$||jk r$td��|Stj|�r^|dkrBtj�}|j|�}|j rZ|j d=|St j r~t j |�r~tt|�|d�Std��dS)zmWrap a coroutine or an awaitable in a future. If the argument is a Future, it is returned directly. Nz$loop argument must agree with Futurer)rz:An asyncio.Future, a coroutine or an awaitable is requiredr$)rrarrdrr%rrZ create_taskr*rZPY35rQZ isawaitabler �_wrap_awaitablerb)r�rr4rrrr �s   ccs|j�EdHS)z�Helper for asyncio.ensure_future(). Wraps awaitable (an object with __await__) into a coroutine that will later be wrapped in a Task by ensure_future(). N)� __await__)Z awaitablerrrr�sr�cs.eZdZdZdd��fdd� Zdd�Z�ZS)�_GatheringFuturez�Helper for gather(). This overrides cancel() to cancel all the children and act more like Task.cancel(), which doesn't immediately mark itself as cancelled. N)rcst�j|d�||_d|_dS)N)rF)r(r)� _children�_cancel_requested)r2�childrenr)r0rrr)$sz_GatheringFuture.__init__cCs:|j�r dSd}x|jD]}|j�rd}qW|r6d|_|S)NFT)r?r�r@r�)r2ZretZchildrrrr@)s z_GatheringFuture.cancel)rVrWrXrYr)r@r]rr)r0rr�sr�F)r�return_exceptionscs|s*|dkrtj�}|j���jg��Si�xjt|�D]^}tj|�sht||d�}|dkr`|j}d|_ n&|}|dkr||j}n|j|k r�t d��|�|<q8W�fdd�|D�}t |��t ||d��d�dg�������fdd �}x&t |�D]\}}|jtj||��q�W�S) a7Return a future aggregating results from the given coroutines or futures. Coroutines will be wrapped in a future and scheduled in the event loop. They will not necessarily be scheduled in the same order as passed in. All futures must share the same event loop. If all the tasks are done successfully, the returned future's result is the list of results (in the order of the original sequence, not necessarily the order of results arrival). If *return_exceptions* is True, exceptions in the tasks are treated the same as successful results, and gathered in the result list; otherwise, the first raised exception will be immediately propagated to the returned future. Cancellation: if the outer Future is cancelled, all children (that have not completed yet) are also cancelled. If any child is cancelled, this is treated as if it raised CancelledError -- the outer Future is *not* cancelled in this case. (This is to prevent the cancellation of one child to cause other children to be cancelled.) N)rFz)futures are tied to different event loopscsg|] }�|�qSrr)r�arg)� arg_to_futrr� <listcomp>hszgather.<locals>.<listcomp>rcs��j�r|j�s|j�dS|j�r@tj�}�sl�j|�dSn,|jdk rf|j�}�sl�j|�dSn|j}|�|<�d7���kr��jr��jtj��n �j ��dS)Nr) r?rtrurrDrHZ _exceptionZ_resultr�rI)�irq�res)� nchildren� nfinished�outer�resultsr�rr�_done_callbackns*   zgather.<locals>._done_callback)rrrkrIrerrar rr6rdrxr�� enumeraterOrmrn)rr�Zcoros_or_futuresr�rqr�r�r�r)r�r�r�r�r�r�rr 8s8       cs@t||d�}|j�r|S|j}|j���fdd�}|j|��S)a=Wait for a future, shielding it from cancellation. The statement res = yield from shield(something()) is exactly equivalent to the statement res = yield from something() *except* that if the coroutine containing it is cancelled, the task running in something() is not cancelled. From the POV of something(), the cancellation did not happen. But its caller is still cancelled, so the yield-from expression still raises CancelledError. Note: If something() is cancelled by other means this will still cancel shield(). If you want to completely ignore cancellation (not recommended) you can combine shield() with a try/except clause, as follows: try: res = yield from shield(something()) except CancelledError: res = None )rcs\�j�r|j�s|j�dS|j�r.�j�n*|j�}|dk rJ�j|�n�j|j��dS)N)rtrur@rHrIrT)�innerrS)r�rrr��s  zshield.<locals>._done_callback)r r?rrkrO)r�rr�r�r)r�rr �s   cs:tj��std��tjj�����fdd�}�j|��S)zsSubmit a coroutine object to a given event loop. Return a concurrent.futures.Future to access the result. zA coroutine object is requiredcsTytjt��d���Wn6tk rN}z�j�r<�j|��WYdd}~XnXdS)N)r)rZ _chain_futurer rKZset_running_or_notify_cancelrH)rS)r3rUrrr�callback�s  z*run_coroutine_threadsafe.<locals>.callback)rr%rb� concurrentrr7Zcall_soon_threadsafe)r3rr�r)r3rUrrr �s    )N)'rY�__all__�concurrent.futuresr�rmrQr�rZ�rrrrrrr7rZ_PyTaskZ_asyncio� ImportErrorZ_CTaskrrrrrjrrfrrr��globalsrVr r�r�r r r rrrr�<module>sZ        s  - -8  W5