class_docstr: A base class providing the backwards-compatible spawn API for Pexpect.
  
  This should not be instantiated directly: use :class:`pexpect.spawn` or
  :class:`pexpect.fdpexpect.fdspawn`.
code: def __init__(
      self,
      timeout=30,
      maxread=2000,
      searchwindowsize=None,
      logfile=None,
      encoding=None,
      codec_errors="strict",
  ):
      self.stdin = sys.stdin
      self.stdout = sys.stdout
      self.stderr = sys.stderr
  
      self.searcher = None
      self.ignorecase = False
      self.before = None
      self.after = None
      self.match = None
      self.match_index = None
      self.terminated = True
      self.exitstatus = None
      self.signalstatus = None
      # status returned by os.waitpid
      self.status = None
      # the child file descriptor is initially closed
      self.child_fd = -1
      self.timeout = timeout
      self.delimiter = EOF
      self.logfile = logfile
      # input from child (read_nonblocking)
      self.logfile_read = None
      # output to send (send, sendline)
      self.logfile_send = None
      # max bytes to read at one time into buffer
      self.maxread = maxread
      # Data before searchwindowsize point is preserved, but not searched.
      self.searchwindowsize = searchwindowsize
      # Delay used before sending data to child. Time in seconds.
      # Set this to None to skip the time.sleep() call completely.
      self.delaybeforesend = 0.05
      # Used by close() to give kernel time to update process status.
      # Time in seconds.
      self.delayafterclose = 0.1
      # Used by terminate() to give kernel time to update process status.
      # Time in seconds.
      self.delayafterterminate = 0.1
      # Delay in seconds to sleep after each call to read_nonblocking().
      # Set this to None to skip the time.sleep() call completely: that
      # would restore the behavior from pexpect-2.0 (for performance
      # reasons or because you don't want to release Python's global
      # interpreter lock).
      self.delayafterread = 0.0001
      self.softspace = False
      self.name = "<" + repr(self) + ">"
      self.closed = True
  
      # Unicode interface
      self.encoding = encoding
      self.codec_errors = codec_errors
      if encoding is None:
          # bytes mode (accepts some unicode for backwards compatibility)
          self._encoder = self._decoder = _NullCoder()
          self.string_type = bytes
          self.buffer_type = BytesIO
          self.crlf = b"\r\n"
          if PY3:
              self.allowed_string_types = (bytes, str)
              self.linesep = os.linesep.encode("ascii")
  
              def write_to_stdout(b):
                  try:
                      return sys.stdout.buffer.write(b)
                  except AttributeError:
                      # If stdout has been replaced, it may not have .buffer
                      return sys.stdout.write(
                          b.decode("ascii", "replace")
                      )
  
              self.write_to_stdout = write_to_stdout
          else:
              self.allowed_string_types = (
                  basestring,
              )  # analysis:ignore
              self.linesep = os.linesep
              self.write_to_stdout = sys.stdout.write
      else:
          # unicode mode
          self._encoder = codecs.getincrementalencoder(encoding)(
              codec_errors
          )
          self._decoder = codecs.getincrementaldecoder(encoding)(
              codec_errors
          )
          self.string_type = text_type
          self.buffer_type = StringIO
          self.crlf = "\r\n"
          self.allowed_string_types = (text_type,)
          if PY3:
              self.linesep = os.linesep
          else:
              self.linesep = os.linesep.decode("ascii")
          # This can handle unicode in both Python 2 and 3
          self.write_to_stdout = sys.stdout.write
      # storage for async transport
      self.async_pw_transport = None
      # This is the read buffer. See maxread.
      self._buffer = self.buffer_type()
      # The buffer may be trimmed for efficiency reasons.  This is the
      # untrimmed buffer, used to create the before attribute.
      self._before = self.buffer_type()
  
imports: from io import StringIO, BytesIO
  import codecs
  import os
  import sys
  import re
  import errno
  from .exceptions import ExceptionPexpect, EOF, TIMEOUT
  from .expect import Expecter, searcher_string, searcher_re
label_desc: Use image node_id 1 to create a new SpawnBase object from inherited base classes: object with example: obj = SpawnBase(timeout, maxread, searchwindowsize, logfile, encoding, codec_errors)