def register(self, socket, flags=POLLIN|POLLOUT):
        if flags:
            self.sockets_flags[socket] = flags
            if isinstance(socket, int):
                self.c_sockets[socket] = _make_zmq_pollitem_fromfd(socket, flags)
            else:
                self.c_sockets[socket] =  _make_zmq_pollitem(socket, flags)
                self._sockets[socket.zmq_socket] = socket
        elif socket in self.sockets_flags:
            # uregister sockets registered with no events
            self.unregister(socket)
        else:
            # ignore new sockets with no events
            pass
dataset/ETHPy150Open felipecruz/zmqpy/zmqpy/zmqpy.py/Poller.register/original