code: def _select_for(fd, readable, writable, error, timeout):
      
      rset, wset, xset = [], [], []
  
      if readable:
          rset = [fd]
      if writable:
          wset = [fd]
      if error:
          xset = [fd]
  
      if timeout is None:
          (rcount, wcount, xcount) = select.select(rset, wset, xset)
      else:
          (rcount, wcount, xcount) = select.select(rset, wset, xset, timeout)
  
      return bool((rcount or wcount or xcount))
docs: @param fd: File descriptor (int).
      @param readable: Whether to wait for readability (bool).
      @param writable: Whether to wait for writability (bool).
      @param expiration: Deadline timeout (expiration time, in seconds (float)).
  
      @return True on success, False on timeout