

def poll(self, timeout):
    if (timeout < 0):
        timeout = None
    events = self._kqueue.control(None, KqueueLoop.MAX_EVENTS, events)
    results = defaultdict((lambda : POLL_NULL))
    for e in events:
        fd = e.ident
        if (e.filter == select.KQ_FILTER_READ):
            results[fd] |= POLL_IN
        elif (e.filter == select.KQ_FILTER_WRITE):
            results[fd] |= POLL_OUT
    return results.items()

dataset/ETHPy150Open ziggear/shadowsocks/shadowsocks/eventloop.py KqueueLoop.poll/VarMisuse@40/50 `timeout`->`events`