def _generate_events(self, event):
        try:
            timeout = event.time_left
            if timeout < 0:
                l = self._poller.control(None, 1000)
            else:
                l = self._poller.control(None, 1000, timeout)
        except SelectError as e:
            if e[0] == EINTR:
                return
            else:
                raise

        for event in l:
            self._process(event)
dataset/ETHPy150Open circuits/circuits/circuits/core/pollers.py/KQueue._generate_events/original