
    zbjw+                       % 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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  \R>                  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/J0r0J1r1J2r2J3r3J4r4J5r5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<  \" S5      r=\" SSS9r>\ " S5      r?\@\A-  \\@   -  \\A   -  rBS\CS'    " S S\S9rDg)     )annotationsN)ABCMetaabstractmethod)AsyncIterator	AwaitableCallable	CoroutineIterableMapping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T_coT)	covariantPosArgsTr   StrOrBytesPathc                     \ rS rSr\\          S:S 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       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\\SAS j5       5       r\\SBS j5       5       r\\SCS j5       5       r\\SS
S.       SDS jj5       5       r\\SES j5       5       r\\  SF         SGS jj5       5       r\\S>S j5       5       r\\        SHS j5       5       r\\        SIS j5       5       r\\SSSSS
SSSSSS.
                               SJS jj5       5       r\\SKS j5       5       r\\ SL       SMS jj5       5       r\\SNS  j5       5       r\\SOS! j5       5       r\\SOS" j5       5       r \\          SPS# j5       5       r!\\"      SQS$ j5       5       r#\\"      SRS% j5       5       r#\\      SSS& j5       5       r#\\SSSSS'.             STS( jj5       5       r$\\ SU     SVS) jj5       5       r%\\SWS* j5       5       r&\\SWS+ j5       5       r'\\SWS, j5       5       r(\\SOS- j5       5       r)\\SXS. j5       5       r*\\SYS/ j5       5       r+\\SZS0 j5       5       r,\\S[S1 j5       5       r-\\S\S2 j5       5       r.\\    S]S3 j5       5       r/\\S^S4 j5       5       r0\\    S_S5 j5       5       r1\\S`S6 j5       5       r2\\SaS7 j5       5       r3\\S>S8 j5       5       r4\\SbS9 j5       5       r5Sr6g)cAsyncBackend;   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        ڐ/tmp/claude-0/-home-danvics-docker-quiz/c1e0577a-e42c-4a3d-b1ea-3edd61103a4e/scratchpad/stt/lib/python3.13/site-packages/anyio/abc/_eventloop.pyrunAsyncBackend.run<           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
Nr:   r;   s    r@   current_tokenAsyncBackend.current_tokenR   rC   rD   c                    g)zb
Return the current value of the event loop's internal clock.

:return: the clock value (seconds)
Nr:   rF   s    r@   current_timeAsyncBackend.current_time\   rC   rD   c                    g)zFReturn the exception class that is raised in a task if it's cancelled.Nr:   rF   s    r@   cancelled_exception_class&AsyncBackend.cancelled_exception_classe   rC   rD   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`.
Nr:   rF   s    r@   
checkpointAsyncBackend.checkpointj           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infrP   rF   s    r@   checkpoint_if_cancelled$AsyncBackend.checkpoint_if_cancelledt   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sleeprF   s    r@   cancel_shielded_checkpoint'AsyncBackend.cancel_shielded_checkpoint   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
Nr:   )r;   delays     r@   r]   AsyncBackend.sleep   rR   rS   F)deadliner[   c                   g Nr:   )r;   rc   r[   s      r@   r\    AsyncBackend.create_cancel_scope       
 	rD   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
Nr:   rF   s    r@   rU   'AsyncBackend.current_effective_deadline   rC   rD   c                    g re   r:   rF   s    r@   create_task_groupAsyncBackend.create_task_group        	rD   c                    g re   r:   rF   s    r@   create_eventAsyncBackend.create_event   rm   rD   c                   g re   r:   )r;   fast_acquires     r@   create_lockAsyncBackend.create_lock   rm   rD   N)	max_valuerr   c                   g re   r:   )r;   initial_valueru   rr   s       r@   create_semaphoreAsyncBackend.create_semaphore   s     	rD   c                    g re   r:   )r;   total_tokenss     r@   create_capacity_limiter$AsyncBackend.create_capacity_limiter   rm   rD   c                   #    g 7fre   r:   )r;   r<   r=   abandon_on_cancellimiters        r@   run_sync_in_worker_thread&AsyncBackend.run_sync_in_worker_thread   
      	rS   c                    g re   r:   rF   s    r@   check_cancelledAsyncBackend.check_cancelled   rm   rD   c                    g re   r:   r;   r<   r=   tokens       r@   run_async_from_thread"AsyncBackend.run_async_from_thread        	rD   c                    g re   r:   r   s       r@   run_sync_from_thread!AsyncBackend.run_sync_from_thread   r   rD   r   r:   )
cwdenvstartupinfocreationflagsstart_new_sessionpass_fdsusergroupextra_groupsumaskc                  #    g 7fre   r:   )r;   commandstdinstdoutstderrr   r   r   r   r   r   r   r   r   r   r>   s                   r@   open_processAsyncBackend.open_process   s
     * 	rS   c                    g re   r:   )r;   workerss     r@   #setup_process_pool_exit_at_shutdown0AsyncBackend.setup_process_pool_exit_at_shutdown  rm   rD   c                   #    g 7fre   r:   )r;   hostportlocal_addresss       r@   connect_tcpAsyncBackend.connect_tcp	  
     
 	rS   c                   #    g 7fre   r:   )r;   paths     r@   connect_unixAsyncBackend.connect_unix  
      	rS   c                    g re   r:   r;   socks     r@   create_tcp_listener AsyncBackend.create_tcp_listener  rm   rD   c                    g re   r:   r   s     r@   create_unix_listener!AsyncBackend.create_unix_listener  rm   rD   c                   #    g 7fre   r:   )r;   familyr   remote_address
reuse_ports        r@   create_udp_socketAsyncBackend.create_udp_socket  r   rS   c                   #    g 7fre   r:   r;   
raw_socketremote_paths      r@   create_unix_datagram_socket(AsyncBackend.create_unix_datagram_socket*  s
      !rS   c                   #    g 7fre   r:   r   s      r@   r   r   0  s
      '*rS   c                   #    g 7fre   r:   r   s      r@   r   r   6  r   rS   )r   typeprotoflagsc                  #    g 7fre   r:   )r;   r   r   r   r   r   r   s          r@   getaddrinfoAsyncBackend.getaddrinfo=  s
     ( 	rS   c                   #    g 7fre   r:   )r;   sockaddrr   s      r@   getnameinfoAsyncBackend.getnameinfoS  r   rS   c                   #    g 7fre   r:   r;   objs     r@   wait_readableAsyncBackend.wait_readableZ  r   rS   c                   #    g 7fre   r:   r   s     r@   wait_writableAsyncBackend.wait_writable_  r   rS   c                    g re   r:   r   s     r@   notify_closingAsyncBackend.notify_closingd  rm   rD   c                   #    g 7fre   r:   r   s     r@   wrap_listener_socket!AsyncBackend.wrap_listener_socketi  r   rS   c                   #    g 7fre   r:   r   s     r@   wrap_stream_socketAsyncBackend.wrap_stream_socketn  r   rS   c                   #    g 7fre   r:   r   s     r@   wrap_unix_stream_socket$AsyncBackend.wrap_unix_stream_sockets  r   rS   c                   #    g 7fre   r:   r   s     r@   wrap_udp_socketAsyncBackend.wrap_udp_socketx  r   rS   c                   #    g 7fre   r:   r   s     r@   wrap_connected_udp_socket&AsyncBackend.wrap_connected_udp_socket}  r   rS   c                   #    g 7fre   r:   r   s     r@   wrap_unix_datagram_socket&AsyncBackend.wrap_unix_datagram_socket  r   rS   c                   #    g 7fre   r:   r   s     r@   #wrap_connected_unix_datagram_socket0AsyncBackend.wrap_connected_unix_datagram_socket  r   rS   c                    g re   r:   rF   s    r@   current_default_thread_limiter+AsyncBackend.current_default_thread_limiter  rm   rD   c                    g re   r:   )r;   signalss     r@   open_signal_receiver!AsyncBackend.open_signal_receiver  rg   rD   c                    g re   r:   rF   s    r@   get_current_taskAsyncBackend.get_current_task  rm   rD   c                    g re   r:   rF   s    r@   get_running_tasksAsyncBackend.get_running_tasks  rm   rD   c                   #    g 7fre   r:   rF   s    r@   wait_all_tasks_blocked#AsyncBackend.wait_all_tasks_blocked  r   rS   c                    g re   r:   )r;   r?   s     r@   create_test_runnerAsyncBackend.create_test_runner  rm   rD   )
r<   z1Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]]r=   tuple[Unpack[PosArgsT]]r>   dict[str, Any]r?   r  returnr1   )r  object)r  float)r  ztype[BaseException])r  None)ra   r	  r  r
  )rc   r	  r[   boolr  r#   )r  r/   )r  r    )rr   r  r  r!   )rw   intru   z
int | Nonerr   r  r  r"   )r{   r	  r  r   )FN)
r<   &Callable[[Unpack[PosArgsT]], T_Retval]r=   r  r   r  r   zCapacityLimiter | Noner  r1   )r<   z7Callable[[Unpack[PosArgsT]], Coroutine[Any, Any, T_co]]r=   r  r   r  r  r2   )r<   r  r=   r  r   r  r  r1   ) r   z)StrOrBytesPath | Sequence[StrOrBytesPath]r   int | IO[Any] | Noner   r  r   r  r   zStrOrBytesPath | Noner   zMapping[str, str] | Noner   r   r   r  r   r  r   zSequence[int]r   str | int | Noner   r  r   zIterable[str | int] | Noner   r  r>   r   r  r.   )r   zset[Process]r  r
  re   )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   r  r   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  r0   )7__name__
__module____qualname____firstlineno__classmethodr   rA   rG   rJ   rM   rP   rX   r^   r]   rV   rW   r\   rU   rk   ro   rs   rx   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  __static_attributes__r:   rD   r@   r7   r7   ;   s   ? & 	
   
  (       U  U    	# 	# 	 	    "&((548	  
 
  
          
 !%" 	
  
      
 #(*.4 &  	
 ( 
      E & 	
 
   4 & 	
 
    &*(,"'"$!%"&37!: $	
 % % # &          1  !" #$ 
%  *    JN!2G	  
           - .	
  
(   !!.2!	!  ! **.9*	$*  * .@	9  
  '(!"  
 $   
  ( 45%.1	  
                            	$  
    	7  
            rD   r7   )	metaclass)E
__future__r   rV   sysabcr   r   collections.abcr   r   r   r	   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/   _testingr0   r1   r2   r4   r  bytesr5   __annotations__r7   r:   rD   r@   <module>r.     s    "  
 '   .   4 4  w++6,PP*)	 	 	 '!$:v&
#%K(3-7(5/I	 IqW qrD   