Hacked By AnonymousFox

Current Path : /opt/alt/python39/lib64/python3.9/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/asyncio/__pycache__/events.cpython-39.opt-1.pyc

a

���eSg�@sndZdZddlZddlZddlZddlZddlZddlZddlm	Z	Gdd�d�Z
Gdd	�d	e
�ZGd
d�d�ZGdd
�d
�Z
Gdd�d�ZGdd�de�Zdae��ZGdd�dej�Ze�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z eZ!eZ"eZ#eZ$zdd*l%mZmZmZmZWne&�yXYn0eZ'eZ(eZ)eZ*dS)+z!Event loop and event loop policy.)�AbstractEventLoopPolicy�AbstractEventLoop�AbstractServer�Handle�TimerHandle�get_event_loop_policy�set_event_loop_policy�get_event_loop�set_event_loop�new_event_loop�get_child_watcher�set_child_watcher�_set_running_loop�get_running_loop�_get_running_loop�N�)�format_helpersc@sFeZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz1Object returned by callback registration methods.)�	_callback�_args�
_cancelled�_loop�_source_traceback�_repr�__weakref__�_contextNcCs\|durt��}||_||_||_||_d|_d|_|j��rRt	�
t�d��|_
nd|_
dS)NFr)�contextvarsZcopy_contextrrrrrr�	get_debugr�
extract_stack�sys�	_getframer)�self�callback�args�loop�context�r%�3/opt/alt/python39/lib64/python3.9/asyncio/events.py�__init__s
�zHandle.__init__cCsl|jjg}|jr|�d�|jdur:|�t�|j|j��|jrh|jd}|�d|d�d|d���|S)N�	cancelled���zcreated at r�:r)	�	__class__�__name__r�appendrr�_format_callback_sourcerr)r �info�framer%r%r&�
_repr_info.s


�
zHandle._repr_infocCs(|jdur|jS|��}d�d�|��S)Nz<{}>� )rr1�format�join)r r/r%r%r&�__repr__:s
zHandle.__repr__cCs0|js,d|_|j��r t|�|_d|_d|_dS)NT)rrr�reprrrr�r r%r%r&�cancel@s

z
Handle.cancelcCs|jS�N)rr7r%r%r&r(KszHandle.cancelledc
Cs�z|jj|jg|j�R�Wn|ttfy4�Ynfty�}zNt�|j|j�}d|��}|||d�}|j	rx|j	|d<|j
�|�WYd}~n
d}~00d}dS)NzException in callback )�messageZ	exception�handleZsource_traceback)r�runrr�
SystemExit�KeyboardInterrupt�
BaseExceptionrr.rr�call_exception_handler)r �exc�cb�msgr$r%r%r&�_runNs"�
�
"zHandle._run)N)r,�
__module__�__qualname__�__doc__�	__slots__r'r1r5r8r(rDr%r%r%r&rs
rcszeZdZdZddgZd�fdd�	Z�fdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Z�fdd�Z
dd�Z�ZS)rz7Object returned by timed callback registration methods.�
_scheduled�_whenNcs0t��||||�|jr |jd=||_d|_dS)Nr)F)�superr'rrJrI)r �whenr!r"r#r$�r+r%r&r'gs
zTimerHandle.__init__cs0t���}|jrdnd}|�|d|j���|S)N�rzwhen=)rKr1r�insertrJ)r r/�posrMr%r&r1os
zTimerHandle._repr_infocCs
t|j�Sr9)�hashrJr7r%r%r&�__hash__uszTimerHandle.__hash__cCst|t�r|j|jkStSr9��
isinstancerrJ�NotImplemented�r �otherr%r%r&�__lt__xs
zTimerHandle.__lt__cCs$t|t�r |j|jkp|�|�StSr9�rTrrJ�__eq__rUrVr%r%r&�__le__}s
zTimerHandle.__le__cCst|t�r|j|jkStSr9rSrVr%r%r&�__gt__�s
zTimerHandle.__gt__cCs$t|t�r |j|jkp|�|�StSr9rYrVr%r%r&�__ge__�s
zTimerHandle.__ge__cCs>t|t�r:|j|jko8|j|jko8|j|jko8|j|jkStSr9)rTrrJrrrrUrVr%r%r&rZ�s

�
�
�zTimerHandle.__eq__cs |js|j�|�t���dSr9)rr�_timer_handle_cancelledrKr8r7rMr%r&r8�szTimerHandle.cancelcCs|jS)z�Return a scheduled callback time.

        The time is an absolute timestamp, using the same time
        reference as loop.time().
        )rJr7r%r%r&rL�szTimerHandle.when)N)r,rErFrGrHr'r1rRrXr[r\r]rZr8rL�
__classcell__r%r%rMr&rbsrc@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rz,Abstract server returned by create_server().cCst�dS)z5Stop serving.  This leaves existing connections open.N��NotImplementedErrorr7r%r%r&�close�szAbstractServer.closecCst�dS)z4Get the event loop the Server object is attached to.Nr`r7r%r%r&�get_loop�szAbstractServer.get_loopcCst�dS)z3Return True if the server is accepting connections.Nr`r7r%r%r&�
is_serving�szAbstractServer.is_servingc�st�dS)z�Start accepting connections.

        This method is idempotent, so it can be called when
        the server is already being serving.
        Nr`r7r%r%r&�
start_serving�szAbstractServer.start_servingc�st�dS)z�Start accepting connections until the coroutine is cancelled.

        The server is closed when the coroutine is cancelled.
        Nr`r7r%r%r&�
serve_forever�szAbstractServer.serve_foreverc�st�dS)z*Coroutine to wait until service is closed.Nr`r7r%r%r&�wait_closed�szAbstractServer.wait_closedc�s|Sr9r%r7r%r%r&�
__aenter__�szAbstractServer.__aenter__c�s|��|��IdHdSr9)rbrg)r rAr%r%r&�	__aexit__�szAbstractServer.__aexit__N)r,rErFrGrbrcrdrerfrgrhrir%r%r%r&r�src@sveZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�dd�Z
dd�dd�Zdd�dd�Zdd�Zdd�Zdd �d!d"�Zdd�d#d$�Zd%d&�Zd'd(�Zd)d)d)d)d*�d+d,�Zdxd-d.�Zdydd)d)d)ddddddd/�
d0d1�Zdzejejdd2ddddd3d4�	d5d6�Zd{d3d7�d8d9�Zd:ddd;�d<d=�Zd|ddddd>�d?d@�Zd}dd2ddd3dA�dBdC�Z d~d)d)d)dddddD�dEdF�Z!dGdH�Z"dIdJ�Z#e$j%e$j%e$j%dK�dLdM�Z&e$j%e$j%e$j%dK�dNdO�Z'dPdQ�Z(dRdS�Z)dTdU�Z*dVdW�Z+dXdY�Z,dZd[�Z-d\d]�Z.d^d_�Z/d`da�Z0ddd7�dbdc�Z1ddde�Z2dfdg�Z3dhdi�Z4djdk�Z5dldm�Z6dndo�Z7dpdq�Z8drds�Z9dtdu�Z:dvdw�Z;dS)�rzAbstract event loop.cCst�dS)z*Run the event loop until stop() is called.Nr`r7r%r%r&�run_forever�szAbstractEventLoop.run_forevercCst�dS)zpRun the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        Nr`)r Zfuturer%r%r&�run_until_complete�sz$AbstractEventLoop.run_until_completecCst�dS)z�Stop the event loop as soon as reasonable.

        Exactly how soon that is may depend on the implementation, but
        no more I/O callbacks should be scheduled.
        Nr`r7r%r%r&�stop�szAbstractEventLoop.stopcCst�dS)z3Return whether the event loop is currently running.Nr`r7r%r%r&�
is_running�szAbstractEventLoop.is_runningcCst�dS)z*Returns True if the event loop was closed.Nr`r7r%r%r&�	is_closed�szAbstractEventLoop.is_closedcCst�dS)z�Close the loop.

        The loop should not be running.

        This is idempotent and irreversible.

        No other methods should be called after this one.
        Nr`r7r%r%r&rb�s	zAbstractEventLoop.closec�st�dS)z,Shutdown all active asynchronous generators.Nr`r7r%r%r&�shutdown_asyncgens�sz$AbstractEventLoop.shutdown_asyncgensc�st�dS)z.Schedule the shutdown of the default executor.Nr`r7r%r%r&�shutdown_default_executor�sz+AbstractEventLoop.shutdown_default_executorcCst�dS)z3Notification that a TimerHandle has been cancelled.Nr`)r r;r%r%r&r^sz)AbstractEventLoop._timer_handle_cancelledN)r$cGs|jd|g|�Rd|i�S)Nrr$)�
call_later�r r!r$r"r%r%r&�	call_soonszAbstractEventLoop.call_sooncGst�dSr9r`)r Zdelayr!r$r"r%r%r&rqszAbstractEventLoop.call_latercGst�dSr9r`)r rLr!r$r"r%r%r&�call_atszAbstractEventLoop.call_atcCst�dSr9r`r7r%r%r&�timeszAbstractEventLoop.timecCst�dSr9r`r7r%r%r&�
create_futureszAbstractEventLoop.create_future)�namecCst�dSr9r`)r �cororwr%r%r&�create_taskszAbstractEventLoop.create_taskcGst�dSr9r`rrr%r%r&�call_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGst�dSr9r`)r �executor�funcr"r%r%r&�run_in_executorsz!AbstractEventLoop.run_in_executorcCst�dSr9r`)r r{r%r%r&�set_default_executor!sz&AbstractEventLoop.set_default_executorr)�family�type�proto�flagsc�st�dSr9r`)r �host�portrr�r�r�r%r%r&�getaddrinfo&szAbstractEventLoop.getaddrinfoc�st�dSr9r`)r Zsockaddrr�r%r%r&�getnameinfo*szAbstractEventLoop.getnameinfo)
�sslrr�r��sock�
local_addr�server_hostname�ssl_handshake_timeout�happy_eyeballs_delay�
interleavec
�st�dSr9r`)r �protocol_factoryr�r�r�rr�r�r�r�r�r�r�r�r%r%r&�create_connection-sz#AbstractEventLoop.create_connection�dT)	rr�r��backlogr��
reuse_address�
reuse_portr�rec	
�st�dS)adA coroutine which creates a TCP server bound to host and port.

        The return value is a Server object which can be used to stop
        the service.

        If host is an empty string or None all interfaces are assumed
        and a list of multiple sockets will be returned (most likely
        one for IPv4 and another one for IPv6). The host parameter can also be
        a sequence (e.g. list) of hosts to bind to.

        family can be set to either AF_INET or AF_INET6 to force the
        socket to use IPv4 or IPv6. If not set it will be determined
        from host (defaults to AF_UNSPEC).

        flags is a bitmask for getaddrinfo().

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for completion of the SSL handshake before aborting the
        connection. Default is 60s.

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nr`)
r r�r�r�rr�r�r�r�r�r�r�rer%r%r&�
create_server6s3zAbstractEventLoop.create_server)�fallbackc�st�dS)zRSend a file through a transport.

        Return an amount of sent bytes.
        Nr`)r �	transport�file�offset�countr�r%r%r&�sendfilekszAbstractEventLoop.sendfileF)�server_sider�r�c�st�dS)z|Upgrade a transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        Nr`)r r�ZprotocolZ
sslcontextr�r�r�r%r%r&�	start_tlsss	zAbstractEventLoop.start_tls)r�r�r�r�c�st�dSr9r`)r r��pathr�r�r�r�r%r%r&�create_unix_connection~sz(AbstractEventLoop.create_unix_connection)r�r�r�r�rec�st�dS)a�A coroutine which creates a UNIX Domain Socket server.

        The return value is a Server object, which can be used to stop
        the service.

        path is a str, representing a file system path to bind the
        server socket to.

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for the SSL handshake to complete (defaults to 60s).

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nr`)r r�r�r�r�r�r�rer%r%r&�create_unix_server�sz$AbstractEventLoop.create_unix_server)rr�r�r�r��allow_broadcastr�c�st�dS)a�A coroutine which creates a datagram endpoint.

        This method will try to establish the endpoint in the background.
        When successful, the coroutine returns a (transport, protocol) pair.

        protocol_factory must be a callable returning a protocol instance.

        socket family AF_INET, socket.AF_INET6 or socket.AF_UNIX depending on
        host (or family if specified), socket type SOCK_DGRAM.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified it will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows and some UNIX's. If the
        :py:data:`~socket.SO_REUSEPORT` constant is not defined then this
        capability is unsupported.

        allow_broadcast tells the kernel to allow this endpoint to send
        messages to the broadcast address.

        sock can optionally be specified in order to use a preexisting
        socket object.
        Nr`)r r�r�Zremote_addrrr�r�r�r�r�r�r%r%r&�create_datagram_endpoint�s!z*AbstractEventLoop.create_datagram_endpointc�st�dS)aRegister read pipe in event loop. Set the pipe to non-blocking mode.

        protocol_factory should instantiate object with Protocol interface.
        pipe is a file-like object.
        Return pair (transport, protocol), where transport supports the
        ReadTransport interface.Nr`�r r��piper%r%r&�connect_read_pipe�sz#AbstractEventLoop.connect_read_pipec�st�dS)aRegister write pipe in event loop.

        protocol_factory should instantiate object with BaseProtocol interface.
        Pipe is file-like object already switched to nonblocking.
        Return pair (transport, protocol), where transport support
        WriteTransport interface.Nr`r�r%r%r&�connect_write_pipe�sz$AbstractEventLoop.connect_write_pipe)�stdin�stdout�stderrc�st�dSr9r`)r r��cmdr�r�r��kwargsr%r%r&�subprocess_shell�sz"AbstractEventLoop.subprocess_shellc�st�dSr9r`)r r�r�r�r�r"r�r%r%r&�subprocess_exec�sz!AbstractEventLoop.subprocess_execcGst�dSr9r`�r �fdr!r"r%r%r&�
add_reader�szAbstractEventLoop.add_readercCst�dSr9r`�r r�r%r%r&�
remove_reader�szAbstractEventLoop.remove_readercGst�dSr9r`r�r%r%r&�
add_writer�szAbstractEventLoop.add_writercCst�dSr9r`r�r%r%r&�
remove_writerszAbstractEventLoop.remove_writerc�st�dSr9r`)r r��nbytesr%r%r&�	sock_recvszAbstractEventLoop.sock_recvc�st�dSr9r`)r r�Zbufr%r%r&�sock_recv_intosz AbstractEventLoop.sock_recv_intoc�st�dSr9r`)r r��datar%r%r&�sock_sendallszAbstractEventLoop.sock_sendallc�st�dSr9r`)r r�Zaddressr%r%r&�sock_connectszAbstractEventLoop.sock_connectc�st�dSr9r`)r r�r%r%r&�sock_acceptszAbstractEventLoop.sock_acceptc�st�dSr9r`)r r�r�r�r�r�r%r%r&�
sock_sendfileszAbstractEventLoop.sock_sendfilecGst�dSr9r`)r �sigr!r"r%r%r&�add_signal_handlersz$AbstractEventLoop.add_signal_handlercCst�dSr9r`)r r�r%r%r&�remove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCst�dSr9r`)r �factoryr%r%r&�set_task_factory"sz"AbstractEventLoop.set_task_factorycCst�dSr9r`r7r%r%r&�get_task_factory%sz"AbstractEventLoop.get_task_factorycCst�dSr9r`r7r%r%r&�get_exception_handler*sz'AbstractEventLoop.get_exception_handlercCst�dSr9r`)r Zhandlerr%r%r&�set_exception_handler-sz'AbstractEventLoop.set_exception_handlercCst�dSr9r`�r r$r%r%r&�default_exception_handler0sz+AbstractEventLoop.default_exception_handlercCst�dSr9r`r�r%r%r&r@3sz(AbstractEventLoop.call_exception_handlercCst�dSr9r`r7r%r%r&r8szAbstractEventLoop.get_debugcCst�dSr9r`)r Zenabledr%r%r&�	set_debug;szAbstractEventLoop.set_debug)r)NN)NN)rN)N)N)NN)rN)<r,rErFrGrjrkrlrmrnrbrorpr^rsrqrtrurvryrzr}r~r�r�r��socketZ	AF_UNSPECZ
AI_PASSIVEr�r�r�r�r�r�r�r��
subprocess�PIPEr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r@rr�r%r%r%r&r�s��
��
��5�	�����!��%
���rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz-Abstract policy for accessing the event loop.cCst�dS)a:Get the event loop for the current context.

        Returns an event loop object implementing the BaseEventLoop interface,
        or raises an exception in case no event loop has been set for the
        current context and the current policy does not specify to create one.

        It should never return None.Nr`r7r%r%r&rBsz&AbstractEventLoopPolicy.get_event_loopcCst�dS)z3Set the event loop for the current context to loop.Nr`�r r#r%r%r&r	Lsz&AbstractEventLoopPolicy.set_event_loopcCst�dS)z�Create and return a new event loop object according to this
        policy's rules. If there's need to set this loop as the event loop for
        the current context, set_event_loop must be called explicitly.Nr`r7r%r%r&r
Psz&AbstractEventLoopPolicy.new_event_loopcCst�dS)z$Get the watcher for child processes.Nr`r7r%r%r&rXsz)AbstractEventLoopPolicy.get_child_watchercCst�dS)z$Set the watcher for child processes.Nr`)r �watcherr%r%r&r\sz)AbstractEventLoopPolicy.set_child_watcherN)	r,rErFrGrr	r
rrr%r%r%r&r?s
rc@sFeZdZdZdZGdd�dej�Zdd�Zdd�Z	d	d
�Z
dd�ZdS)
�BaseDefaultEventLoopPolicya�Default policy implementation for accessing the event loop.

    In this policy, each thread has its own event loop.  However, we
    only automatically create an event loop by default for the main
    thread; other threads by default have no event loop.

    Other policies may have different rules (e.g. a single global
    event loop, or automatically creating an event loop per thread, or
    using some other notion of context to which an event loop is
    associated).
    Nc@seZdZdZdZdS)z!BaseDefaultEventLoopPolicy._LocalNF)r,rErFr�_set_calledr%r%r%r&�_Localpsr�cCs|��|_dSr9)r��_localr7r%r%r&r'tsz#BaseDefaultEventLoopPolicy.__init__cCsX|jjdur2|jjs2t��t��ur2|�|���|jjdurPtdt��j	��|jjS)zvGet the event loop for the current context.

        Returns an instance of EventLoop or raises an exception.
        Nz,There is no current event loop in thread %r.)
r�rr��	threadingZcurrent_threadZmain_threadr	r
�RuntimeErrorrwr7r%r%r&rws���z)BaseDefaultEventLoopPolicy.get_event_loopcCsd|j_||j_dS)zSet the event loop.TN)r�r�rr�r%r%r&r	�sz)BaseDefaultEventLoopPolicy.set_event_loopcCs|��S)zvCreate a new event loop.

        You must call set_event_loop() to make this the current event
        loop.
        )�
_loop_factoryr7r%r%r&r
�sz)BaseDefaultEventLoopPolicy.new_event_loop)r,rErFrGr�r��localr�r'rr	r
r%r%r%r&r�asr�c@seZdZdZdS)�_RunningLoop)NNN)r,rErF�loop_pidr%r%r%r&r��sr�cCst�}|durtd��|S)zrReturn the running event loop.  Raise a RuntimeError if there is none.

    This function is thread-specific.
    Nzno running event loop)rr��r#r%r%r&r�srcCs&tj\}}|dur"|t��kr"|SdS)z�Return the running event loop or None.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    N)�
_running_loopr��os�getpid)Zrunning_loop�pidr%r%r&r�s
rcCs|t��ft_dS)z�Set the running event loop.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    N)r�r�r�r�r�r%r%r&r
�sr
cCsBt�*tdur ddlm}|�aWd�n1s40YdS)Nr��DefaultEventLoopPolicy)�_lock�_event_loop_policy�r�r�r%r%r&�_init_event_loop_policy�sr�cCstdurt�tS)z"Get the current event loop policy.N)r�r�r%r%r%r&r�srcCs|adS)zZSet the current event loop policy.

    If policy is None, the default policy is restored.N)r�)Zpolicyr%r%r&r�srcCst�}|dur|St���S)aGReturn an asyncio event loop.

    When called from a coroutine or a callback (e.g. scheduled with call_soon
    or similar API), this function will always return the running event loop.

    If there is no running event loop set, the function will return
    the result of `get_event_loop_policy().get_event_loop()` call.
    N)rrr)Zcurrent_loopr%r%r&r�s
rcCst��|�dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr	r�r%r%r&r	�sr	cCs
t���S)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr
r%r%r%r&r
�sr
cCs
t���S)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rrr%r%r%r&r�srcCst��|�S)zMEquivalent to calling
    get_event_loop_policy().set_child_watcher(watcher).)rr)r�r%r%r&rsr)rr
rr)+rG�__all__rr�r�r�rr�r�rrrrrrr�r�ZLockr�r�r�r�rrr
r�rrrr	r
rrZ_py__get_running_loopZ_py__set_running_loopZ_py_get_running_loopZ_py_get_event_loopZ_asyncio�ImportErrorZ_c__get_running_loopZ_c__set_running_loopZ_c_get_running_loopZ_c_get_event_loopr%r%r%r&�<module>sVJ@*u"9
	

Hacked By AnonymousFox1.0, Coded By AnonymousFox