python (3.11.7)

(root)/
lib/
python3.11/
asyncio/
__pycache__/
timeouts.cpython-311.opt-1.pyc

eddlZddlmZddlmZmZmZddlmZddlm	Z	ddlm
Z
dZGd	d
ejZ
eGddZd
eedefdZdeedefdZdS)N)
TracebackType)finalOptionalType)events)
exceptions)tasks)Timeouttimeout
timeout_atc"eZdZdZdZdZdZdZdS)_StatecreatedactiveexpiringexpiredfinishedN)__name__
__module____qualname__CREATEDENTEREDEXPIRINGEXPIREDEXITEDD/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/asyncio/timeouts.pyrrs'GGHG
FFFrrc	eZdZdZdeeddfdZdeefdZdeeddfdZde	fdZ
defd	Zdd
Z
deeedeed
eedee	fdZddZdS)rzAsynchronous context manager for cancelling overdue coroutines.

    Use `timeout()` or `timeout_at()` rather than instantiating this class directly.
    whenreturnNcRtj|_d|_d|_||_dS)zSchedule a timeout that will trigger at a given loop time.

        - If `when` is `None`, the timeout will never trigger.
        - If `when < loop.time()`, the timeout will trigger on the next
          iteration of the event loop.
        N)rr_state_timeout_handler_task_when)selfr!s  r__init__zTimeout.__init__!s'n>B+/



rc|jS)zReturn the current deadline.)r'r(s rr!zTimeout.when.s
zrc|jtjur?|jtjurt	dt	d|jjd||_|j|j|	d|_dStj
}||kr!||j
|_dS|||j
|_dS)zReschedule the timeout.zTimeout has not been enteredzCannot change state of z TimeoutN)r$rrrRuntimeErrorvaluer'r%cancelrget_running_looptime	call_soon_on_timeoutcall_at)r(r!loops   r
reschedulezTimeout.reschedule2s;fn,,{fn,,"#ABBBE$+*;EEE

 ,!((***<$(D!!!*,,Dtyy{{""(,t7G(H(H%%%(,T4;K(L(L%%%rc@|jtjtjfvS)z$Is timeout expired during execution?)r$rrrr+s rrzTimeout.expiredIs{v???rcdg}|jtjur6|jt	|jdnd}|d|d|}d|jjd|dS)Nzwhen= z
<Timeout []>)r$rrr'roundappendjoinr.)r(infor!info_strs    r__repr__zTimeout.__repr__Mszt;&.((+/:+A5Q'''tDKK'''88D>>;DK-;;;;;;rc6K|jtjurtdt	j}|tdtj|_||_|j|_	|
|j|S)Nz Timeout has already been enteredz$Timeout should be used inside a task)r$rrr-r
current_taskrr&
cancelling_cancellingr6r')r(tasks  r
__aenter__zTimeout.__aenter__Us;fn,,ABBB!##<EFFFn
:0022
###rexc_typeexc_valexc_tbcZK|j |jd|_|jtjurJtj|_|j|jkr|tj
urt|n$|jtjurtj
|_dSN)r%r/r$rrrr&uncancelrGr	CancelledErrorTimeoutErrorrr)r(rJrKrLs    r	__aexit__zTimeout.__aexit__as ,!((***$(D!;&/)) .DKz""$$(888XIb=b=b#/
[FN
*
* -DKtrch|jtj|_d|_dSrN)r&r/rrr$r%r+s rr3zTimeout._on_timeoutys-
o $r)r"r)r"N)rrr__doc__rfloatr)r!r6boolrstrrCrIr
BaseExceptionrrRr3rrrrrsD
Xe_huoMxM4MMMM.@@@@@<#<<<<



4
./-('	

$0%%%%%%rrdelayr"cxtj}t|||zndS)a	Timeout async context manager.

    Useful in cases when you want to apply timeout logic around block
    of code or in cases when asyncio.wait_for is not suitable. For example:

    >>> async with asyncio.timeout(10):  # 10 seconds timeout
    ...     await long_running_task()


    delay - value in seconds or None to disable timeout logic

    long_running_task() is interrupted by raising asyncio.CancelledError,
    the top-most affected timeout() context manager converts CancelledError
    into TimeoutError.
    N)rr0rr1)rYr5s  rrrs7 "$$D%*;499;;&&FFFrr!c t|S)abSchedule the timeout at absolute time.

    Like timeout() but argument gives absolute time in the same clock system
    as loop.time().

    Please note: it is not POSIX time but a time with
    undefined starting base, e.g. the time of the system power on.

    >>> async with asyncio.timeout_at(loop.time() + 10):
    ...     await long_running_task()


    when - a deadline when timeout occurs or None to disable timeout logic

    long_running_task() is interrupted by raising asyncio.CancelledError,
    the top-most affected timeout() context manager converts CancelledError
    into TimeoutError.
    )r)r!s rr
r
s&4==r)enumtypesrtypingrrrr9rr	r
__all__EnumrrrUrr
rrr<module>ras@((((((((((TYc%c%c%c%c%c%c%c%LG8E?GwGGGG(Xe_r