<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def modify(self, fileobj, events, data=None):
 """ Modify interest in specified IO events on the specified file object :param fileobj: Any existing file-like object that has a fileno() method :param events: A bitmask composed of EVENT_READ and EVENT_WRITE :param data: (optional) Arbitrary data :raises ValueError: if `fileobj` is invalid or not supported :raises KeyError: if the descriptor associated with `fileobj` is not registered. :returns: The new :class:`SelectorKey` associated with the passed arguments """

        fd = _get_fd(fileobj)
        epoll_events = _EpollSelectorEvents(events).get_epoll_events()
        if fd not in self._fd_map:
            raise KeyError("{!r} is not registered".format(fileobj))
        key = SelectorKey(fileobj, fd, events, data)
        self._fd_map[fd] = key
        self._epoll.modify(fd, epoll_events)
        return key