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: //home/arjun/projects/env/lib/python3.10/site-packages/dns/__pycache__/asyncbackend.cpython-310.pyc
o

!we�
�@s�UddlmZddlZddlmZmZmZmZda	iZ
eeefed<dZ
Gdd�dejj�Zded	efd
d�Zd	efdd
�Zd	efdd�Zded	efdd�ZdS)�)�DictN)�Backend�DatagramSocket�Socket�StreamSocket�	_backendsFc@seZdZdS)�AsyncLibraryNotFoundErrorN)�__name__�
__module__�__qualname__�rr�I/home/arjun/projects/env/lib/python3.10/site-packages/dns/asyncbackend.pyrsr�name�returncCsdt�|�}|r	|S|dkrddl}|j��}n|dkr%ddl}|j��}ntd|����|t|<|S)z�Get the specified asynchronous backend.

    *name*, a ``str``, the name of the backend.  Currently the "trio"
    and "asyncio" backends are available.

    Raises NotImplementError if an unknown backend name is specified.
    �triorN�asynciozunimplemented async backend )r�get�dns._trio_backend�
_trio_backendr�dns._asyncio_backend�_asyncio_backend�NotImplementedError)r�backend�dnsrrr
�get_backends
	rcCsvztrt�ddl}z|��WWS|jytd��wty:ddl}z|��WYdSty9td��ww)z�Attempt to determine the in-use asynchronous I/O library by using
    the ``sniffio`` module if it is available.

    Returns the name of the library, or raises AsyncLibraryNotFoundError
    if the library cannot be determined.
    rNz&sniffio cannot determine async libraryrzno async library detected)�_no_sniffio�ImportError�sniffio�current_async_libraryrr�get_running_loop�RuntimeError)rrrrr
�sniff7s$���r!cCstrtStt��S)z6Get the default backend, initializing it if necessary.)�_default_backend�set_default_backendr!rrrr
�get_default_backendRs
r$cCst|�atS)a,Set the default backend.

    It's not normally necessary to call this method, as
    ``get_default_backend()`` will initialize the backend
    appropriately in many cases.  If ``sniffio`` is not installed, or
    in testing situations, this function allows the backend to be set
    explicitly.
    )rr")rrrr
r#Zs
r#)�typingr�
dns.exceptionr�dns._asyncbackendrrrrr"r�str�__annotations__r�	exception�DNSExceptionrrr!r$r#rrrr
�<module>s