HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/anyio/abc/__pycache__/_eventloop.cpython-310.pyc
o

���g�%�@s�UddlmZddlZddlZddlmZmZddlmZm	Z	m
Z
mZddlm
Z
ddlmZddlmZddlmZmZmZdd	lmZmZmZmZmZmZejd
kr]ddlmZmZnddlmZmZejdkrqdd
lm Z ndd
lm Z er�ddl!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<ed�Z=ed�Z>ee?e@ddfZAdeBd<Gdd �d ed!�ZCdS)"�)�annotationsN)�ABCMeta�abstractmethod)�
AsyncIterator�	Awaitable�Callable�Sequence)�AbstractContextManager)�PathLike)�Signals)�
AddressFamily�
SocketKind�socket)�IO�
TYPE_CHECKING�Any�TypeVar�Union�overload)��)�TypeVarTuple�Unpack)r�
)�	TypeAlias)�	HasFileno�)�CapacityLimiter�Event�Lock�	Semaphore)�CancelScope)�TaskInfo)�BlockingPortal�)�ConnectedUDPSocket�ConnectedUNIXDatagramSocket�IPSockAddrType�SocketListener�SocketStream�	UDPSocket�UNIXDatagramSocket�UNIXSocketStream)�Process)�	TaskGroup)�
TestRunner�T_Retval�PosArgsTz
PathLike[str]zPathLike[bytes]r�StrOrBytesPathc@seZdZeed�d
d���Zeed�d
d���Zeed�dd���Zeed�dd���Zeed�dd���Z	ed�dd��Z
ed�dd��Zeed�dd���Zeee
jdd �d�d%d&���Zeed�d'd(���Zeed�d*d+���Zeed�d-d.���Zeed�d1d2���Zeed3dd4�d�d:d;���Zeed�d>d?���Zee		3d�d�dDdE���Zeed�dFdG���Zeed�dIdJ���Zeed�dKdL���Zeed�dNdO���Zeed�dXdY���Zeed�d\d]���Zee	3d�d�ddde���Zeed�didj���Zeed�dndo���Zeed�dpdq���Z eed�dwdx���Z!ee"d�d|d}���Z#ee"d�dd}���Z#eed�d�d}���Z#eed�d�d�d�d��d�d�d����Z$ee	�d�d�d�d����Z%eed�d�d����Z&eed�d�d����Z'eed�d�d����Z(eed�d�d����Z)eed�d�d����Z*eed�d�d����Z+eed�d�d����Z,eed�d�d����Z-d3S)��AsyncBackend�func�1Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]]�args�tuple[Unpack[PosArgsT]]�kwargs�dict[str, Any]�options�returnr0cC�dS)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�)�clsr4r6r8r:r=r=�?/usr/local/lib/python3.10/dist-packages/anyio/abc/_eventloop.py�run9�zAsyncBackend.run�objectcCr<)z

        :return:
        Nr=�r>r=r=r?�
current_tokenOrAzAsyncBackend.current_token�floatcCr<)zz
        Return the current value of the event loop's internal clock.

        :return: the clock value (seconds)
        Nr=rCr=r=r?�current_timeWrAzAsyncBackend.current_time�type[BaseException]cCr<)zFReturn the exception class that is raised in a task if it's cancelled.Nr=rCr=r=r?�cancelled_exception_class`rAz&AsyncBackend.cancelled_exception_class�Nonec���dS)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=rCr=r=r?�
checkpointe�zAsyncBackend.checkpointc�s(�|��tjkr|��IdHdSdS)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�infrKrCr=r=r?�checkpoint_if_cancelledos�	�z$AsyncBackend.checkpoint_if_cancelledc�sD�|jdd��|�d�IdHWd�dS1swYdS)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)�shieldrN)�create_cancel_scope�sleeprCr=r=r?�cancel_shielded_checkpoint{s�	"�z'AsyncBackend.cancel_shielded_checkpoint�delayc�rJ)zt
        Pause the current task for the specified duration.

        :param delay: the duration, in seconds
        Nr=)r>rUr=r=r?rS�rLzAsyncBackend.sleepF)�deadlinerQrVrQ�boolr!cC�dS�Nr=)r>rVrQr=r=r?rR��z AsyncBackend.create_cancel_scopecCr<)aQ
        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=rCr=r=r?rM�rAz'AsyncBackend.current_effective_deadliner.cCrXrYr=rCr=r=r?�create_task_group��zAsyncBackend.create_task_grouprcCrXrYr=rCr=r=r?�create_event�r\zAsyncBackend.create_event�fast_acquirercCrXrYr=)r>r^r=r=r?�create_lock�r\zAsyncBackend.create_lockN)�	max_valuer^�
initial_value�intr`�
int | Noner cCrXrYr=)r>rar`r^r=r=r?�create_semaphore�s	zAsyncBackend.create_semaphore�total_tokensrcCrXrYr=)r>rer=r=r?�create_capacity_limiter�r\z$AsyncBackend.create_capacity_limiter�&Callable[[Unpack[PosArgsT]], T_Retval]�abandon_on_cancel�limiter�CapacityLimiter | Nonec���dSrYr=)r>r4r6rhrir=r=r?�run_sync_in_worker_thread���	z&AsyncBackend.run_sync_in_worker_threadcCrXrYr=rCr=r=r?�check_cancelled�r\zAsyncBackend.check_cancelled�tokencCrXrYr=�r>r4r6ror=r=r?�run_async_from_thread��z"AsyncBackend.run_async_from_threadcCrXrYr=rpr=r=r?�run_sync_from_thread�rrz!AsyncBackend.run_sync_from_threadr#cCrXrYr=rCr=r=r?�create_blocking_portal�r\z#AsyncBackend.create_blocking_portal�command�)StrOrBytesPath | Sequence[StrOrBytesPath]�stdin�int | IO[Any] | None�stdout�stderrrr-c�rkrYr=)r>rurwryrzr8r=r=r?�open_process�s�zAsyncBackend.open_process�workers�set[Process]cCrXrYr=)r>r|r=r=r?�#setup_process_pool_exit_at_shutdown�r\z0AsyncBackend.setup_process_pool_exit_at_shutdown�host�str�port�
local_address�IPSockAddrType | Noner)c�rkrYr=)r>rr�r�r=r=r?�connect_tcp���zAsyncBackend.connect_tcp�path�str | bytesr,c�rkrYr=)r>r�r=r=r?�connect_unix��zAsyncBackend.connect_unix�sockrr(cCrXrYr=�r>r�r=r=r?�create_tcp_listenerr\z AsyncBackend.create_tcp_listenercCrXrYr=r�r=r=r?�create_unix_listenerr\z!AsyncBackend.create_unix_listener�familyr�remote_address�
reuse_port�UDPSocket | ConnectedUDPSocketc�rkrYr=)r>r�r�r�r�r=r=r?�create_udp_socketrmzAsyncBackend.create_udp_socket�
raw_socket�remote_pathr+c�rkrYr=�r>r�r�r=r=r?�create_unix_datagram_socket ��z(AsyncBackend.create_unix_datagram_socketr&c�rkrYr=r�r=r=r?r�&r��str | bytes | None�0UNIXDatagramSocket | ConnectedUNIXDatagramSocketc�rkrYr=r�r=r=r?r�,r�r)r��type�proto�flags�bytes | str | None�str | int | None�int | AddressFamilyr��int | SocketKindr�r��]list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]c�rkrYr=)r>rr�r�r�r�r�r=r=r?�getaddrinfo3s�zAsyncBackend.getaddrinfo�sockaddrr'�tuple[str, str]c�rkrYr=)r>r�r�r=r=r?�getnameinfoIr�zAsyncBackend.getnameinfo�obj�HasFileno | intc�rkrYr=�r>r�r=r=r?�
wait_readablePr�zAsyncBackend.wait_readablec�rkrYr=r�r=r=r?�
wait_writableUr�zAsyncBackend.wait_writablecCrXrYr=rCr=r=r?�current_default_thread_limiterZr\z+AsyncBackend.current_default_thread_limiter�signalsr�.AbstractContextManager[AsyncIterator[Signals]]cGrXrYr=)r>r�r=r=r?�open_signal_receiver_rZz!AsyncBackend.open_signal_receiverr"cCrXrYr=rCr=r=r?�get_current_taskfr\zAsyncBackend.get_current_task�Sequence[TaskInfo]cCrXrYr=rCr=r=r?�get_running_taskskr\zAsyncBackend.get_running_tasksc�rkrYr=rCr=r=r?�wait_all_tasks_blockedpr�z#AsyncBackend.wait_all_tasks_blockedr/cCrXrYr=)r>r:r=r=r?�create_test_runnerur\zAsyncBackend.create_test_runner)
r4r5r6r7r8r9r:r9r;r0)r;rB)r;rE)r;rG)r;rI)rUrEr;rI)rVrErQrWr;r!)r;r.)r;r)r^rWr;r)rarbr`rcr^rWr;r )rerEr;r)FN)
r4rgr6r7rhrWrirjr;r0)r4r5r6r7rorBr;r0)r4rgr6r7rorBr;r0)r;r#)rurvrwrxryrxrzrxr8rr;r-)r|r}r;rIrY)rr�r�rbr�r�r;r))r�r�r;r,)r�rr;r()
r�rr�r�r�r�r�rWr;r�)r�rr�rIr;r+)r�rr�r�r;r&)r�rr�r�r;r�)rr�r�r�r�r�r�r�r�rbr�rbr;r�)r)r�r'r�rbr;r�)r�r�r;rI)r;r)r�rr;r�)r;r")r;r�)r:r9r;r/).�__name__�
__module__�__qualname__�classmethodrr@rDrFrHrKrPrTrSrNrOrRrMr[r]r_rdrfrlrnrqrsrtr{r~r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r=r=r=r?r38s��	�	�	��r3)�	metaclass)D�
__future__rrN�sys�abcrr�collections.abcrrrr�
contextlibr	�osr
�signalrrrr
�typingrrrrrr�version_inforr�typing_extensionsr�	_typeshedr�_core._synchronizationrrrr �_core._tasksr!�_core._testingr"�from_threadr#�_socketsr%r&r'r(r)r*r+r,�
_subprocessesr-�_tasksr.�_testingr/r0r1r��bytesr2�__annotations__r3r=r=r=r?�<module>s< 
	
(