code: def fromfd(cls, fd, mode='rb', bufsize=-1):
          
          fp = object.__new__(cls)  # bypass __init__
          fp._rbuf = StringIO()
          fp.encoding = None
          fp.mode = mode
          fp._fileno = fd
          fp._closed = False
  
          cls._add_flags(fd, cls._mode_to_flags(mode))
          fp._set_up_waiting()
  
          return fp
docs: create a cooperating greenhouse file from an existing descriptor
  
          :param fd: the file descriptor to wrap in a new file object
          :type fd: int
          :param mode: the file mode
          :type mode: str
          :param bufsize:
              the size of read buffer to use. 0 indicates unbuffered, and < 0
              means use the system default. defaults to -1
  
          :returns: a new :class:`File` object connected to the descriptor