class_docstr: This is like pexpect.spawn but allows you to supply your own open file
  descriptor. For example, you could use it to read through a file looking
  for patterns, or to control a modem or serial device. 
class_docstr_tok: ["This","is","like","pexpect.spawn","but","allows","you","to","supply","your","own","open","file","descriptor",".","For","example",",","you","could","use","it","to","read","through","a","file","looking","for","patterns",",","or","to","control","a","modem","or","serial","device","."]
docstr: This takes a file descriptor (an int) or an object that support the
  fileno() method (returning an int). All Python file-like objects
  support fileno(). 
docstr_tok: ["This","takes","a","file","descriptor","(","an","int",")","or","an","object","that","support","the","fileno","(",")","method","(","returning","an","int",")",".","All","Python","file-like","objects","support","fileno","(",")","."]
code: def __init__(
      self,
      fd,
      args=None,
      timeout=30,
      maxread=2000,
      searchwindowsize=None,
      logfile=None,
      encoding=None,
      codec_errors="strict",
      use_poll=False,
  ):
      """This takes a file descriptor (an int) or an object that support the
      fileno() method (returning an int). All Python file-like objects
      support fileno()."""
  
      if type(fd) != type(0) and hasattr(fd, "fileno"):
          fd = fd.fileno()
  
      if type(fd) != type(0):
          raise ExceptionPexpect(
              "The fd argument is not an int. If this is a command string then maybe you want to use pexpect.spawn."
          )
  
      try:  # make sure fd is a valid file descriptor
          os.fstat(fd)
      except OSError:
          raise ExceptionPexpect(
              "The fd argument is not a valid file descriptor."
          )
  
      self.args = None
      self.command = None
      SpawnBase.__init__(
          self,
          timeout,
          maxread,
          searchwindowsize,
          logfile,
          encoding=encoding,
          codec_errors=codec_errors,
      )
      self.child_fd = fd
      self.own_fd = False
      self.closed = False
      self.name = "<file descriptor %d>" % fd
      self.use_poll = use_poll
  
file_path: catboost/contrib/python/pexpect/py2/pexpect/fdpexpect.py
imports: from .spawnbase import SpawnBase
  from .exceptions import ExceptionPexpect, TIMEOUT
  from .utils import select_ignore_interrupts, poll_ignore_interrupts
  import os
label_desc: Use image node_id 1 to create a new fdspawn object from inherited base classes: SpawnBase with example: obj = fdspawn(fd, args, timeout, maxread, searchwindowsize, logfile, encoding, codec_errors, use_poll)