def METHOD_NAME(
    sock: socket.socket,
    read: bool = False,
    write: bool = False,
    timeout: float | None = None,
) -> bool:
    # We delay choosing which implementation to use until the first time we're
    # called. We could do it at import time, but then we might make the wrong
    # decision if someone goes wild with monkeypatching select.poll after
    # we're imported.
    global METHOD_NAME
    if _have_working_poll():
        METHOD_NAME = poll_wait_for_socket
    elif hasattr(select, "select"):
        METHOD_NAME = select_wait_for_socket
    return METHOD_NAME(sock, read, write, timeout)