code: def select(
      rlist: List,
      wlist: List,
      xlist: List,
      timeout: Optional[float] = None,
  ):
      """select(rlist, wlist, xlist, timeout=None) -> (rlist, wlist, xlist)
  
      Return the result of poll as a lists of sockets ready for r/w/exception.
  
      This has the same interface as Python's built-in ``select.select()`` function.
  
      Parameters
      ----------
      timeout : float, int, optional
          The timeout in seconds. If None, no timeout (infinite). This is in seconds to be
          compatible with ``select.select()``.
      rlist : list of sockets/FDs
          sockets/FDs to be polled for read events
      wlist : list of sockets/FDs
          sockets/FDs to be polled for write events
      xlist : list of sockets/FDs
          sockets/FDs to be polled for error events
  
      Returns
      -------
      (rlist, wlist, xlist) : tuple of lists of sockets (length 3)
          Lists correspond to sockets available for read/write/error events respectively.
      """
      if timeout is None:
          timeout = -1
      # Convert from sec -> ms for zmq_poll.
      # zmq_poll accepts 3.x style timeout in ms
      timeout = int(timeout * 1000.0)
      if timeout < 0:
          timeout = -1
      sockets = []
      for s in set(rlist + wlist + xlist):
          flags = 0
          if s in rlist:
              flags |= POLLIN
          if s in wlist:
              flags |= POLLOUT
          if s in xlist:
              flags |= POLLERR
          sockets.append((s, flags))
      return_sockets = zmq_poll(sockets, timeout)
      rlist, wlist, xlist = [], [], []
      for s, flags in return_sockets:
          if flags & POLLIN:
              rlist.append(s)
          if flags & POLLOUT:
              wlist.append(s)
          if flags & POLLERR:
              xlist.append(s)
      return rlist, wlist, xlist
  
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 1 for calling a global function with example usage: select(rlist, wlist, xlist, timeout) and returns: rlist,  wlist,  xlist