def METHOD_NAME(self, fd, read=False, write=False, timeout=None, timeout_exc=None):
    if self._closed:
        # Don't trampoline if we're already closed.
        raise IOClosed()
    try:
        return trampoline(fd, read=read, write=write, timeout=timeout,
                          timeout_exc=timeout_exc,
                          mark_as_closed=self._mark_as_closed)
    except IOClosed:
        # Our fileno has been obsoleted. Defang ourselves to
        # prevent spurious closes.
        self._mark_as_closed()
        raise