class_docstr: A stateful poll interface that mirrors Python's built-in poll.
class_docstr_tok: ["A","stateful","poll","interface","that","mirrors","Python","'s","built-in","poll","."]
docstr: p.register(socket, flags=POLLIN|POLLOUT)
  
  Register a 0MQ socket or native fd for I/O monitoring.
  
  register(s,0) is equivalent to unregister(s).
  
  Parameters
  ----------
  socket : zmq.Socket or native socket
      A zmq.Socket or any Python object having a ``fileno()``
      method that returns a valid file descriptor.
  flags : int
      The events to watch for.  Can be POLLIN, POLLOUT or POLLIN|POLLOUT.
      If `flags=0`, socket will be unregistered.
docstr_tok: ["p.register","(","socket",",","flags=POLLIN|POLLOUT",")","Register","a","0MQ","socket","or","native","fd","for","I\/O","monitoring",".","register","(","s,0",")","is","equivalent","to","unregister","(","s",")",".","Parameters","--","--","--","--","--","socket",":","zmq.Socket","or","native","socket","A","zmq.Socket","or","any","Python","object","having","a","``","fileno","(",")","``","method","that","returns","a","valid","file","descriptor",".","flags",":","int","The","events","to","watch","for",".","Can","be","POLLIN",",","POLLOUT","or","POLLIN|POLLOUT",".","If","`","flags=0","`",",","socket","will","be","unregistered","."]
code: def register(self, socket: Any, flags: int = POLLIN | POLLOUT):
      """p.register(socket, flags=POLLIN|POLLOUT)
  
      Register a 0MQ socket or native fd for I/O monitoring.
  
      register(s,0) is equivalent to unregister(s).
  
      Parameters
      ----------
      socket : zmq.Socket or native socket
          A zmq.Socket or any Python object having a ``fileno()``
          method that returns a valid file descriptor.
      flags : int
          The events to watch for.  Can be POLLIN, POLLOUT or POLLIN|POLLOUT.
          If `flags=0`, socket will be unregistered.
      """
      if flags:
          if socket in self._map:
              idx = self._map[socket]
              self.sockets[idx] = (socket, flags)
          else:
              idx = len(self.sockets)
              self.sockets.append((socket, flags))
              self._map[socket] = idx
      elif socket in self._map:
          # uregister sockets registered with no events
          self.unregister(socket)
      else:
          # ignore new sockets with no events
          pass
  
file_path: catboost/contrib/python/pyzmq/py3/zmq/sugar/poll.py
imports: from typing import Any, Dict, List, Optional, Tuple
  from zmq.backend import zmq_poll
  from zmq.constants import POLLERR, POLLIN, POLLOUT
label_desc: Use image node_id 3 for calling the Poller obj's underlying member method code with example usage: obj.register(socket, flags) without return types