code: def nn_poll(fds, timeout=-1):
      
      polls = []
      for i, entry in enumerate(fds.items()):
          s = PollFds()
          fd, event = entry
          s.fd = fd
          s.events = event
          s.revents = 0
          polls.append(s)
  
      poll_array = (PollFds*len(fds))(*polls)
      res = _nn_poll(poll_array, len(fds), int(timeout))
      if res <= 0:
          return res, {}
      return res, {item.fd: item.revents for item in poll_array}
docs: nn_pollfds
      :param fds: dict (file descriptor => pollmode)
      :param timeout: timeout in milliseconds
      :return: