404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.219.83.72: ~ $
from .selectors import (
    HAS_SELECT,
    DefaultSelector,
    EVENT_READ,
    EVENT_WRITE
)


def _wait_for_io_events(socks, events, timeout=None):
    """ Waits for IO events to be available from a list of sockets
    or optionally a single socket if passed in. Returns a list of
    sockets that can be interacted with immediately. """
    if not HAS_SELECT:
        raise ValueError('Platform does not have a selector')
    if not isinstance(socks, list):
        # Probably just a single socket.
        if hasattr(socks, "fileno"):
            socks = [socks]
        # Otherwise it might be a non-list iterable.
        else:
            socks = list(socks)
    with DefaultSelector() as selector:
        for sock in socks:
            selector.register(sock, events)
        return [key[0].fileobj for key in
                selector.select(timeout) if key[1] & events]


def wait_for_read(socks, timeout=None):
    """ Waits for reading to be available from a list of sockets
    or optionally a single socket if passed in. Returns a list of
    sockets that can be read from immediately. """
    return _wait_for_io_events(socks, EVENT_READ, timeout)


def wait_for_write(socks, timeout=None):
    """ Waits for writing to be available from a list of sockets
    or optionally a single socket if passed in. Returns a list of
    sockets that can be written to immediately. """
    return _wait_for_io_events(socks, EVENT_WRITE, timeout)

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 1.02 KB 0644
connection.py File 4.14 KB 0644
request.py File 3.61 KB 0644
response.py File 2.28 KB 0644
retry.py File 14.73 KB 0644
selectors.py File 20.65 KB 0644
ssl_.py File 12.03 KB 0644
timeout.py File 9.53 KB 0644
url.py File 6.63 KB 0644
wait.py File 1.42 KB 0644