code: def select_fds(read_fds, timeout, selector=AutoSelector):
      
      # Map to ensure that we return the objects that were passed in originally.
      # Whether they are a fd integer or an object that has a fileno().
      # (The 'poll' implementation for instance, returns always integers.)
      fd_map = dict((fd_to_int(fd), fd) for fd in read_fds)
  
      # Wait, using selector.
      sel = selector()
      try:
          for fd in read_fds:
              sel.register(fd)
  
          result = sel.select(timeout)
  
          if result is not None:
              return [fd_map[fd_to_int(fd)] for fd in result]
      finally:
          sel.close()
docs: Wait for a list of file descriptors (`read_fds`) to become ready for
      reading. This chooses the most appropriate select-tool for use in
      prompt-toolkit.