'Return the key associated to a given file descriptor.
Parameters:
fd -- file descriptor
Returns:
corresponding key, or None if not found'

def _key_from_fd(self, fd):

    try:
        return self._fd_to_key[fd]
    except KeyError:
        return None
