
    ܈h                        S SK Jr  S SKrS SKJr  S SKJr  S SKJr  SSK	J
r
Jr  SS	KJr   " S
 S\\   5      r\" 5       r " S S5      r\ S     SS jj5       rSSS jjrSS jrSS jrg)    )annotationsN)	Generator)contextmanager)TracebackType   )	TaskGroup
TaskStatus   )get_async_backendc                  "    \ rS rSrSSS jjrSrg)_IgnoredTaskStatus   Nc                    g N selfvalues     :D:\TimeStamps\venv\Lib\site-packages\anyio/_core/_tasks.pystarted_IgnoredTaskStatus.started   s        r   r   )r   objectreturnNone)__name__
__module____qualname____firstlineno__r   __static_attributes__r   r   r   r   r      s     r   r   c                     \ rS rSrSr\R                  SS.     SS jjrSSS jjr\	SS j5       r
\
R                  SS	 j5       r
\	SS
 j5       r\	SS j5       r\	SS j5       r\R                  SS j5       rSS jr        SS jrSrg)CancelScope   z
Wraps a unit of work that can be made separately cancellable.

:param deadline: The time (clock value) when this scope is cancelled automatically
:param shield: ``True`` to shield the cancel scope from external cancellation
Fdeadlineshieldc               0    [        5       R                  X!S9$ )N)r&   r%   )r   create_cancel_scope)clsr%   r&   s      r   __new__CancelScope.__new__   s     !"66f6XXr   Nc                    [         e)zf
Cancel this scope immediately.

:param reason: a message describing the reason for the cancellation

NotImplementedError)r   reasons     r   cancelCancelScope.cancel!   s
     "!r   c                    [         e)z{
The time (clock value) when this scope is cancelled automatically.

Will be ``float('inf')`` if no timeout has been set.

r-   r   s    r   r%   CancelScope.deadline*   
     "!r   c                    [         er   r-   r   s     r   r%   r4   4       !!r   c                    [         e)z+``True`` if :meth:`cancel` has been called.r-   r3   s    r   cancel_calledCancelScope.cancel_called8   s
     "!r   c                    [         e)aO  
``True`` if this scope suppressed a cancellation exception it itself raised.

This is typically used to check if any work was interrupted, or to see if the
scope was cancelled due to its deadline being reached. The value will, however,
only be ``True`` if the cancellation was triggered by the scope itself (and not
an outer scope).

r-   r3   s    r   cancelled_caughtCancelScope.cancelled_caught=   s
     "!r   c                    [         e)z
``True`` if this scope is shielded from external cancellation.

While a scope is shielded, it will not receive cancellations from outside.

r-   r3   s    r   r&   CancelScope.shieldJ   r5   r   c                    [         er   r-   r   s     r   r&   r?   T   r7   r   c                    [         er   r-   r3   s    r   	__enter__CancelScope.__enter__X   s    !!r   c                    [         er   r-   )r   exc_typeexc_valexc_tbs       r   __exit__CancelScope.__exit__[   s
     "!r   r   )r%   floatr&   boolr   r"   r   )r/   z
str | Noner   r   r   rJ   )r   rJ   r   r   )r   rK   )r   rK   r   r   )r   r"   )rE   ztype[BaseException] | NonerF   zBaseException | NonerG   zTracebackType | Noner   rK   )r   r   r   r   __doc__mathinfr*   r0   propertyr%   setterr9   r<   r&   rB   rH   r    r   r   r   r"   r"      s     #'((5YY48Y	Y
" " " __" " " " 
" 
" " " ]]" """," &" %	"
 
"r   r"   c              #  2  #    [        5       R                  nU b
  U" 5       U -   O[        R                  n[        5       R	                  X1S9 nUv   SSS5        WR
                  (       a  U" 5       UR                  :  a  [        egg! , (       d  f       N<= f7f)a  
Create a context manager which raises a :class:`TimeoutError` if does not finish in
time.

:param delay: maximum allowed time (in seconds) before raising the exception, or
    ``None`` to disable the timeout
:param shield: ``True`` to shield the cancel scope from external cancellation
:return: a context manager that yields a cancel scope
:rtype: :class:`~typing.ContextManager`\[:class:`~anyio.CancelScope`\]

Nr$   )r   current_timerN   rO   r(   r<   r%   TimeoutError)delayr&   rS   r%   cancel_scopes        r   
fail_afterrW   d   s      %&33L+0+<&$((H			0	0 
1 
	

 $$<;P;P)P *Q$
 
s   A	BB6B
BBc                    U b  [        5       R                  5       U -   O[        R                  n[        5       R	                  X!S9$ )a,  
Create a cancel scope with a deadline that expires after the given delay.

:param delay: maximum allowed time (in seconds) before exiting the context block, or
    ``None`` to disable the timeout
:param shield: ``True`` to shield the cancel scope from external cancellation
:return: a cancel scope

r$   )r   rS   rN   rO   r(   )rU   r&   r%   s      r   move_on_afterrY   ~   sB     9>8I			)	)	+e	3txx  22H2TTr   c                 2    [        5       R                  5       $ )a#  
Return the nearest deadline among all the cancel scopes effective for the current
task.

:return: a clock value from the event loop's internal clock (or ``float('inf')`` if
    there is no deadline in effect, or ``float('-inf')`` if the current scope has
    been cancelled)
:rtype: float

)r   current_effective_deadliner   r   r   r[   r[      s     99;;r   c                 2    [        5       R                  5       $ )z.
Create a task group.

:return: a task group

)r   create_task_groupr   r   r   r]   r]      s     0022r   )F)rU   float | Noner&   rK   r   z"Generator[CancelScope, None, None])rU   r^   r&   rK   r   r"   rL   )r   r   )
__future__r   rN   collections.abcr   
contextlibr   typesr   
abc._tasksr   r	   
_eventloopr   r   r   TASK_STATUS_IGNOREDr"   rW   rY   r[   r]   r   r   r   <module>rf      s    "  % %  . )F+ 
 )* M" M"` (-!%' 2U <3r   