

def poll(self, timeout):
    kevents = self._kqueue.control(None, 1000, kevent)
    events = {
        
    }
    for kevent in kevents:
        fd = kevent.ident
        flags = 0
        if (kevent.filter == select.KQ_FILTER_READ):
            events[fd] = (events.get(fd, 0) | IOLoop.READ)
        if (kevent.filter == select.KQ_FILTER_WRITE):
            events[fd] = (events.get(fd, 0) | IOLoop.WRITE)
        if (kevent.flags & select.KQ_EV_ERROR):
            events[fd] = (events.get(fd, 0) | IOLoop.ERROR)
    return events.items()

dataset/ETHPy150Open HenryHu/pybbs/xmpp/aio.py _KQueue.poll/VarMisuse@24/30 `timeout`->`kevent`