
    Xi)                       % S SK Jr  S SKrS SKrS SKJrJr  S SKJrJ	r	J
r
Jr  S SKJr  S SKJr  S SKJr  S SKJrJrJr  S S	KJrJrJrJrJrJr  \R8                  S
:  a	  S SKJrJr  OS SKJrJr  \(       aD  S SK J!r!  SSK"J#r#J$r$J%r%J&r&  SSK'J(r(  SSK)J*r*  SSK+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3  SSK4J5r5  SSK6J7r7  SSK8J9r9  \" S5      r:\" S5      r;\<\=-  \\<   -  \\=   -  r>S\?S'    " S S\S9r@g)    )annotationsN)ABCMetaabstractmethod)AsyncIterator	AwaitableCallableSequence)AbstractContextManager)PathLike)Signals)AddressFamily
SocketKindsocket)IOTYPE_CHECKINGAny	TypeAliasTypeVaroverload)      )TypeVarTupleUnpack)FileDescriptorLike   )CapacityLimiterEventLock	Semaphore)CancelScope)TaskInfo   )ConnectedUDPSocketConnectedUNIXDatagramSocketIPSockAddrTypeSocketListenerSocketStream	UDPSocketUNIXDatagramSocketUNIXSocketStream)Process)	TaskGroup)
TestRunnerT_RetvalPosArgsTr   StrOrBytesPathc                     \ rS rSr\\          S8S j5       5       r\\S9S j5       5       r\\S:S j5       5       r\\S;S j5       5       r	\\S<S j5       5       r
\S<S j5       r\S<S j5       r\\S=S	 j5       5       r\\\R                  S
S.     S>S jj5       5       r\\S:S j5       5       r\\S?S j5       5       r\\S@S j5       5       r\\SAS j5       5       r\\SS
S.       SBS jj5       5       r\\SCS j5       5       r\\  SD         SES jj5       5       r\\S<S j5       5       r\\        SFS j5       5       r\\        SGS j5       5       r\\            SHS j5       5       r\\SIS j5       5       r\\ SJ       SKS jj5       5       r\\SLS j5       5       r\\SMS j5       5       r\\SMS j5       5       r \\          SNS j5       5       r!\\"      SOS  j5       5       r#\\"      SPS! j5       5       r#\\      SQS" j5       5       r#\\S#S#S#S#S$.             SRS% jj5       5       r$\\ SS     STS& jj5       5       r%\\SUS' j5       5       r&\\SUS( j5       5       r'\\SUS) j5       5       r(\\SMS* j5       5       r)\\SVS+ j5       5       r*\\SWS, j5       5       r+\\SXS- j5       5       r,\\SYS. j5       5       r-\\SZS/ j5       5       r.\\    S[S0 j5       5       r/\\S\S1 j5       5       r0\\    S]S2 j5       5       r1\\S^S3 j5       5       r2\\S_S4 j5       5       r3\\S<S5 j5       5       r4\\S`S6 j5       5       r5S7r6g)aAsyncBackend2   c                    g)a  
Run the given coroutine function in an asynchronous event loop.

The current thread must not be already running an event loop.

:param func: a coroutine function
:param args: positional arguments to ``func``
:param kwargs: positional arguments to ``func``
:param options: keyword arguments to call the backend ``run()`` implementation
    with
:return: the return value of the coroutine function
N )clsfuncargskwargsoptionss        ?/app/.venv/lib/python3.13/site-packages/anyio/abc/_eventloop.pyrunAsyncBackend.run3           c                    g)z
Return an object that allows other threads to run code inside the event loop.

:return: a token object, specific to the event loop running in the current
    thread
Nr5   r6   s    r;   current_tokenAsyncBackend.current_tokenI   r>   r?   c                    g)zb
Return the current value of the event loop's internal clock.

:return: the clock value (seconds)
Nr5   rA   s    r;   current_timeAsyncBackend.current_timeS   r>   r?   c                    g)zFReturn the exception class that is raised in a task if it's cancelled.Nr5   rA   s    r;   cancelled_exception_class&AsyncBackend.cancelled_exception_class\   r>   r?   c                   #    g7f)z
Check if the task has been cancelled, and allow rescheduling of other tasks.

This is effectively the same as running :meth:`checkpoint_if_cancelled` and then
:meth:`cancel_shielded_checkpoint`.
Nr5   rA   s    r;   
checkpointAsyncBackend.checkpointa           c                   #    U R                  5       [        R                  * :X  a  U R                  5       I Sh  vN   gg N7f)z
Check if the current task group has been cancelled.

This will check if the task has been cancelled, but will not allow other tasks
to be scheduled if not.

N)current_effective_deadlinemathinfrK   rA   s    r;   checkpoint_if_cancelled$AsyncBackend.checkpoint_if_cancelledk   s6      ))+y8..""" 9"s   7AA Ac                   #    U R                  SS9   U R                  S5      I Sh  vN   SSS5        g N! , (       d  f       g= f7f)z
Allow the rescheduling of other tasks.

This will give other tasks the opportunity to run, but without checking if the
current task group has been cancelled, unlike with :meth:`checkpoint`.

T)shieldr   N)create_cancel_scopesleeprA   s    r;   cancel_shielded_checkpoint'AsyncBackend.cancel_shielded_checkpointw   s<      $$D$1))A, 21 21s%   A757	A7
AAc                   #    g7f)z\
Pause the current task for the specified duration.

:param delay: the duration, in seconds
Nr5   )r6   delays     r;   rX   AsyncBackend.sleep   rM   rN   F)deadlinerV   c                   g Nr5   )r6   r^   rV   s      r;   rW    AsyncBackend.create_cancel_scope       
 	r?   c                    g)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
    - ``inf`` if there is no deadline in effect
    - ``-inf`` if the current scope has been cancelled
:rtype: float
Nr5   rA   s    r;   rP   'AsyncBackend.current_effective_deadline   r>   r?   c                    g r`   r5   rA   s    r;   create_task_groupAsyncBackend.create_task_group        	r?   c                    g r`   r5   rA   s    r;   create_eventAsyncBackend.create_event   rh   r?   c                   g r`   r5   )r6   fast_acquires     r;   create_lockAsyncBackend.create_lock   rh   r?   N)	max_valuerm   c                   g r`   r5   )r6   initial_valuerp   rm   s       r;   create_semaphoreAsyncBackend.create_semaphore   s     	r?   c                    g r`   r5   )r6   total_tokenss     r;   create_capacity_limiter$AsyncBackend.create_capacity_limiter   rh   r?   c                   #    g 7fr`   r5   )r6   r7   r8   abandon_on_cancellimiters        r;   run_sync_in_worker_thread&AsyncBackend.run_sync_in_worker_thread   
      	rN   c                    g r`   r5   rA   s    r;   check_cancelledAsyncBackend.check_cancelled   rh   r?   c                    g r`   r5   r6   r7   r8   tokens       r;   run_async_from_thread"AsyncBackend.run_async_from_thread        	r?   c                    g r`   r5   r   s       r;   run_sync_from_thread!AsyncBackend.run_sync_from_thread   r   r?   c                  #    g 7fr`   r5   )r6   commandstdinstdoutstderrr9   s         r;   open_processAsyncBackend.open_process   s
      	rN   c                    g r`   r5   )r6   workerss     r;   #setup_process_pool_exit_at_shutdown0AsyncBackend.setup_process_pool_exit_at_shutdown   rh   r?   c                   #    g 7fr`   r5   )r6   hostportlocal_addresss       r;   connect_tcpAsyncBackend.connect_tcp   
     
 	rN   c                   #    g 7fr`   r5   )r6   paths     r;   connect_unixAsyncBackend.connect_unix   
      	rN   c                    g r`   r5   r6   socks     r;   create_tcp_listener AsyncBackend.create_tcp_listener  rh   r?   c                    g r`   r5   r   s     r;   create_unix_listener!AsyncBackend.create_unix_listener  rh   r?   c                   #    g 7fr`   r5   )r6   familyr   remote_address
reuse_ports        r;   create_udp_socketAsyncBackend.create_udp_socket  r~   rN   c                   #    g 7fr`   r5   r6   
raw_socketremote_paths      r;   create_unix_datagram_socket(AsyncBackend.create_unix_datagram_socket  s
      !rN   c                   #    g 7fr`   r5   r   s      r;   r   r     s
      '*rN   c                   #    g 7fr`   r5   r   s      r;   r   r   #  r   rN   r   )r   typeprotoflagsc                  #    g 7fr`   r5   )r6   r   r   r   r   r   r   s          r;   getaddrinfoAsyncBackend.getaddrinfo*  s
     ( 	rN   c                   #    g 7fr`   r5   )r6   sockaddrr   s      r;   getnameinfoAsyncBackend.getnameinfo@  r   rN   c                   #    g 7fr`   r5   r6   objs     r;   wait_readableAsyncBackend.wait_readableG  r   rN   c                   #    g 7fr`   r5   r   s     r;   wait_writableAsyncBackend.wait_writableL  r   rN   c                    g r`   r5   r   s     r;   notify_closingAsyncBackend.notify_closingQ  rh   r?   c                   #    g 7fr`   r5   r   s     r;   wrap_listener_socket!AsyncBackend.wrap_listener_socketV  r   rN   c                   #    g 7fr`   r5   r   s     r;   wrap_stream_socketAsyncBackend.wrap_stream_socket[  r   rN   c                   #    g 7fr`   r5   r   s     r;   wrap_unix_stream_socket$AsyncBackend.wrap_unix_stream_socket`  r   rN   c                   #    g 7fr`   r5   r   s     r;   wrap_udp_socketAsyncBackend.wrap_udp_sockete  r   rN   c                   #    g 7fr`   r5   r   s     r;   wrap_connected_udp_socket&AsyncBackend.wrap_connected_udp_socketj  r   rN   c                   #    g 7fr`   r5   r   s     r;   wrap_unix_datagram_socket&AsyncBackend.wrap_unix_datagram_socketo  r   rN   c                   #    g 7fr`   r5   r   s     r;   #wrap_connected_unix_datagram_socket0AsyncBackend.wrap_connected_unix_datagram_sockett  r   rN   c                    g r`   r5   rA   s    r;   current_default_thread_limiter+AsyncBackend.current_default_thread_limiter{  rh   r?   c                    g r`   r5   )r6   signalss     r;   open_signal_receiver!AsyncBackend.open_signal_receiver  rb   r?   c                    g r`   r5   rA   s    r;   get_current_taskAsyncBackend.get_current_task  rh   r?   c                    g r`   r5   rA   s    r;   get_running_tasksAsyncBackend.get_running_tasks  rh   r?   c                   #    g 7fr`   r5   rA   s    r;   wait_all_tasks_blocked#AsyncBackend.wait_all_tasks_blocked  r   rN   c                    g r`   r5   )r6   r:   s     r;   create_test_runnerAsyncBackend.create_test_runner  rh   r?   r5   )
r7   1Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]]r8   tuple[Unpack[PosArgsT]]r9   dict[str, Any]r:   r   returnr.   )r   object)r   float)r   ztype[BaseException])r   None)r\   r   r   r   )r^   r   rV   boolr   r    )r   r,   )r   r   )rm   r   r   r   )rr   intrp   z
int | Nonerm   r   r   r   )rv   r   r   r   )FN)
r7   &Callable[[Unpack[PosArgsT]], T_Retval]r8   r   rz   r   r{   zCapacityLimiter | Noner   r.   )r7   r   r8   r   r   r   r   r.   )r7   r   r8   r   r   r   r   r.   )r   z)StrOrBytesPath | Sequence[StrOrBytesPath]r   int | IO[Any] | Noner   r   r   r   r9   r   r   r+   )r   zset[Process]r   r   r`   )r   strr   r   r   IPSockAddrType | Noner   r'   )r   str | bytesr   r*   )r   r   r   r&   )
r   r   r   r  r   r  r   r   r   zUDPSocket | ConnectedUDPSocket)r   r   r   r   r   r)   )r   r   r   r  r   r$   )r   r   r   zstr | bytes | Noner   z0UNIXDatagramSocket | ConnectedUNIXDatagramSocket)r   zbytes | str | Noner   zstr | int | Noner   zint | AddressFamilyr   zint | SocketKindr   r   r   r   r   zuSequence[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]])r   )r   r%   r   r   r   ztuple[str, str])r   r   r   r   )r   r   r   r'   )r   r   r   r*   )r   r   r   r(   )r   r   r   r#   )r   r   r   r)   )r   r   r   r$   )r   r   )r   r   r   z.AbstractContextManager[AsyncIterator[Signals]])r   r!   )r   zSequence[TaskInfo])r:   r   r   r-   )7__name__
__module____qualname____firstlineno__classmethodr   r<   rB   rE   rH   rK   rS   rY   rX   rQ   rR   rW   rP   rf   rj   rn   rs   rw   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r5   r?   r;   r2   r2   2   s{   ? & 	
   
  (       U  U    	# 	# 	 	    "&((548	  
 
  
          
 !%" 	
  
      
 #(*.4 &  	
 ( 
      ? & 	
 
   4 & 	
 
   	:	 $		
 %	 %	 	 
	  	    JN!2G	  
           - .	
  
(   !!.2!	!  ! **.9*	$*  * .@	9  
  '(!"  
 $   
  ( 45%.1	  
                            	$  
    	7  
            r?   r2   )	metaclass)A
__future__r   rQ   sysabcr   r   collections.abcr   r   r   r	   
contextlibr
   osr   signalr   r   r   r   typingr   r   r   r   r   r   version_infor   r   typing_extensions	_typeshedr   _core._synchronizationr   r   r   r   _core._tasksr    _core._testingr!   _socketsr#   r$   r%   r&   r'   r(   r)   r*   _subprocessesr+   _tasksr,   _testingr-   r.   r/   r   bytesr0   __annotations__r2   r5   r?   r;   <module>r     s    "  
 ' H H -   4 4  w++6,PP*)	 	 	 '!$:
#%K(3-7(5/I	 IgW gr?   