ó
    F\h®  ã                   óÌ   • S SK r S SKJr  S SKJrJrJr  SSKJr  SSKJ	r	  SSKJ
r
  Sr " S	 S
\ R                  5      r\ " S S5      5       rS\\   S\4S jrS\\   S\4S jrg)é    N)ÚTracebackType)ÚfinalÚOptionalÚTypeé   )Úevents)Ú
exceptions)Útasks)ÚTimeoutÚtimeoutÚ
timeout_atc                   ó(   • \ rS rSrSrSrSrSrSrSr	g)	Ú_Stateé   ÚcreatedÚactiveÚexpiringÚexpiredÚfinished© N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚCREATEDÚENTEREDÚEXPIRINGÚEXPIREDÚEXITEDÚ__static_attributes__r   ó    Ú'/usr/lib/python3.13/asyncio/timeouts.pyr   r      s   † Ø€GØ€GØ€HØ€GØƒFr!   r   c            	       óà   • \ rS rSrSrS\\   SS4S jrS\\   4S jrS\\   SS4S jr	S\
4S	 jrS\4S
 jrSS jrS\\\      S\\   S\\   S\\
   4S jrSS jr\S\SS4S j5       rSrg)r   é   z’Asynchronous context manager for cancelling overdue coroutines.

Use `timeout()` or `timeout_at()` rather than instantiating this class directly.
ÚwhenÚreturnNc                 óV   • [         R                  U l        SU l        SU l        Xl        g)zÒSchedule 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)r   r   Ú_stateÚ_timeout_handlerÚ_taskÚ_when)Úselfr%   s     r"   Ú__init__ÚTimeout.__init__!   s#   € ô —n‘nˆŒà>BˆÔØ+/ˆŒ
Ø�
r!   c                 ó   • U R                   $ )zReturn the current deadline.)r+   ©r,   s    r"   r%   ÚTimeout.when.   s   € à�z‰zÐr!   c                 ó  • U R                   [        R                  LaK  U R                   [        R                  L a  [	        S5      e[	        SU R                   R
                   S35      eXl        U R                  b  U R                  R                  5         Uc  SU l        g[        R                  " 5       nXR                  5       ::  a!  UR                  U R                  5      U l        gUR                  XR                  5      U l        g)zReschedule the timeout.zTimeout has not been enteredzCannot change state of z TimeoutN)r(   r   r   r   ÚRuntimeErrorÚvaluer+   r)   Úcancelr   Úget_running_loopÚtimeÚ	call_soonÚ_on_timeoutÚcall_at)r,   r%   Úloops      r"   Ú
rescheduleÚTimeout.reschedule2   sÌ   € à�;‰;œfŸn™nÒ,Ø�{‰{œfŸn™nÒ,Ü"Ð#AÓBÐBÜØ)¨$¯+©+×*;Ñ*;Ð)<¸HÐEóð ð Œ
à× Ñ Ñ,Ø×!Ñ!×(Ñ(Ô*à‰<Ø$(ˆDÕ!ä×*Ò*Ó,ˆDØ—y‘y“{Ó"Ø(,¯©°t×7GÑ7GÓ(H�Õ%à(,¯©°T×;KÑ;KÓ(L�Õ%r!   c                 ó\   • U R                   [        R                  [        R                  4;   $ )z$Is timeout expired during execution?)r(   r   r   r   r0   s    r"   r   ÚTimeout.expiredI   s   € à�{‰{œvŸ™´·±Ð?Ñ?Ð?r!   c                 ó  • S/nU R                   [        R                  L a9  U R                  b  [	        U R                  S5      OS nUR                  SU 35        SR                  U5      nSU R                   R                   SU S3$ )NÚ é   zwhen=Ú z
<Timeout [Ú]Ú>)r(   r   r   r+   ÚroundÚappendÚjoinr4   )r,   Úinfor%   Úinfo_strs       r"   Ú__repr__ÚTimeout.__repr__M   ss   € ØˆtˆØ�;‰;œ&Ÿ.™.Ò(Ø+/¯:©:Ñ+A”5˜Ÿ™ QÔ'ÀtˆDØ�K‰K˜% ˜v˜Ô'Ø—8‘8˜D“>ˆØ˜DŸK™K×-Ñ-Ð.¨a°¨z¸Ð;Ð;r!   c              ƒ   óN  #   • U R                   [        R                  La  [        S5      e[        R
                  " 5       nUc  [        S5      e[        R                  U l         Xl        U R                  R                  5       U l	        U R                  U R                  5        U $ 7f)Nz Timeout has already been enteredz$Timeout should be used inside a task)r(   r   r   r3   r
   Úcurrent_taskr   r*   Ú
cancellingÚ_cancellingr<   r+   )r,   Útasks     r"   Ú
__aenter__ÚTimeout.__aenter__U   sz   é € Ø�;‰;œfŸn™nÒ,ÜÐAÓBÐBÜ×!Ò!Ó#ˆØ‰<ÜÐEÓFÐFÜ—n‘nˆŒØŒ
ØŸ:™:×0Ñ0Ó2ˆÔØ�‰˜Ÿ
™
Ô#Øˆùs   ‚B#B%Úexc_typeÚexc_valÚexc_tbc              ƒ   óÎ  #   • U R                   [        R                  [        R                  4;   d   eU R                  b!  U R                  R                  5         S U l        U R                   [        R                  L a´  [        R                  U l         U R                  R                  5       U R                  ::  av  Ubs  [        U[        R                  5      (       a  [        UeUbJ  U R                  U5        [        U[         5      (       a$  UR                   H  nU R                  U5        M     g U R                   [        R                  L a  [        R"                  U l         g 7f©N)r(   r   r   r   r)   r5   r   r*   ÚuncancelrP   Ú
issubclassr	   ÚCancelledErrorÚTimeoutErrorÚ_insert_timeout_errorÚ
isinstanceÚExceptionGroupr   )r,   rT   rU   rV   Úexcs        r"   Ú	__aexit__ÚTimeout.__aexit__a   s  é € ð �{‰{œvŸ~™~¬v¯©Ð?Ó?Ð?Ð?à× Ñ Ñ,Ø×!Ñ!×(Ñ(Ô*Ø$(ˆDÔ!à�;‰;œ&Ÿ/™/Ò)Ü Ÿ.™.ˆDŒKà�z‰z×"Ñ"Ó$¨×(8Ñ(8Ó8¸XÑ=Qô ˜h¬
×(AÑ(A×BÑBÜ&¨GÐ3ØÑ(Ø×.Ñ.¨wÔ7Ü! '¬>×:Ñ:Ø#*×#5Ô#5˜CØ ×6Ñ6°sÖ;ñ $6ð
 ð �[‰[œFŸN™NÒ*Ü Ÿ-™-ˆDŒKàùs   ‚E#E%c                 ó®   • U R                   [        R                  L d   eU R                  R	                  5         [        R
                  U l         S U l        g rX   )r(   r   r   r*   r5   r   r)   r0   s    r"   r9   ÚTimeout._on_timeout   s;   € Ø�{‰{œfŸn™nÒ,Ð,Ð,Ø�
‰
×ÑÔÜ—o‘oˆŒà $ˆÕr!   c                 óú   • U R                   bn  [        U R                   [        R                  5      (       a)  [	        5       nU R                   =Ul         Ul        Xl         g U R                   n U R                   b  Mm  g g rX   )Ú__context__r^   r	   r[   r\   Ú	__cause__)rU   Útes     r"   r]   ÚTimeout._insert_timeout_error†   sd   € à×!Ñ!Ñ-Ü˜'×-Ñ-¬z×/HÑ/H×IÑIÜ!“^�Ø07×0CÑ0CÐC�” ¤Ø&(Ô#ØØ×)Ñ)ˆGð ×!Ñ!Õ-r!   )rP   r(   r*   r)   r+   )r&   r   )r&   N)r   r   r   r   Ú__doc__r   Úfloatr-   r%   r<   Úboolr   ÚstrrK   rR   r   ÚBaseExceptionr   ra   r9   Ústaticmethodr]   r    r   r!   r"   r   r      sÑ   † ñð
˜X e™_ð °ô ð�h˜u‘oô ðM˜x¨™ð M°4ô Mð.@˜ô @ð<˜#ô <ô
ðà˜4 Ñ.Ñ/ðð ˜-Ñ(ðð ˜Ñ'ð	ð
 
�$‰ôô<%ð ð* }ð *¸ó *ó ó*r!   r   Údelayr&   c                 óv   • [         R                  " 5       n[        U b  UR                  5       U -   5      $ S5      $ )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)r   r6   r   r7   )rp   r;   s     r"   r   r   ‘   s5   € ô  ×"Ò"Ó$€DÜ¨%Ñ*;�4—9‘9“; Ñ&ÓFÐFÀÓFÐFr!   r%   c                 ó   • [        U 5      $ )a6  Schedule 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    r"   r   r   ¥   s   € ô& �4‹=Ðr!   )ÚenumÚtypesr   Útypingr   r   r   rA   r   r	   r
   Ú__all__ÚEnumr   r   rk   r   r   r   r!   r"   Ú<module>rx      s   ðÛ å ß (Ñ (å Ý Ý ð€ôˆT�Y‰Yô ð ÷s*ð s*ó ðs*ðlG�8˜E‘?ð G wô Gð(�X˜e‘_ð ¨õ r!   