code: def poll2(timeout=0.0, map=None):
      # Use the poll() support added to the select module in Python 2.0
      if map is None:
          map = socket_map
      if timeout is not None:
          # timeout is in milliseconds
          timeout = int(timeout * 1000)
      pollster = select.poll()
      if map:
          for fd, obj in list(map.items()):
              flags = 0
              if obj.readable():
                  flags |= select.POLLIN | select.POLLPRI
              # accepting sockets should not be writable
              if obj.writable() and not obj.accepting:
                  flags |= select.POLLOUT
              if flags:
                  pollster.register(fd, flags)
  
          r = pollster.poll(timeout)
          for fd, flags in r:
              obj = map.get(fd)
              if obj is None:
                  continue
              readwrite(obj, flags)
  
imports: import select
  import socket
  import sys
  import time
  import warnings
  import os
  from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, ENOTCONN, ESHUTDOWN, EISCONN, EBADF, ECONNABORTED, EPIPE, EAGAIN, errorcode
label_desc: Use image node_id 7 for calling a global function with example usage: poll2(timeout, map) without return types