class_docstr: Wrapper for a REPL.
  
  :param cmd_or_spawn: This can either be an instance of :class:`pexpect.spawn`
    in which a REPL has already been started, or a str command to start a new
    REPL process.
  :param str orig_prompt: The prompt to expect at first.
  :param str prompt_change: A command to change the prompt to something more
    unique. If this is ``None``, the prompt will not be changed. This will
    be formatted with the new and continuation prompts as positional
    parameters, so you can use ``{}`` style formatting to insert them into
    the command.
  :param str new_prompt: The more unique prompt to expect after the change.
  :param str extra_init_cmd: Commands to do extra initialisation, such as
    disabling pagers.
class_docstr_tok: ["Wrapper","for","a","REPL",".",":","param","cmd_or_spawn",":","This","can","either","be","an","instance","of",":","class",":","`","pexpect.spawn","`","in","which","a","REPL","has","already","been","started",",","or","a","str","command","to","start","a","new","REPL","process",".",":","param","str","orig_prompt",":","The","prompt","to","expect","at","first",".",":","param","str","prompt_change",":","A","command","to","change","the","prompt","to","something","more","unique",".","If","this","is","``","None","``",",","the","prompt","will","not","be","changed",".","This","will","be","formatted","with","the","new","and","continuation","prompts","as","positional","parameters",",","so","you","can","use","``","{","}","``","style","formatting","to","insert","them","into","the","command",".",":","param","str","new_prompt",":","The","more","unique","prompt","to","expect","after","the","change",".",":","param","str","extra_init_cmd",":","Commands","to","do","extra","initialisation",",","such","as","disabling","pagers","."]
code: def __init__(
      self,
      cmd_or_spawn,
      orig_prompt,
      prompt_change,
      new_prompt=PEXPECT_PROMPT,
      continuation_prompt=PEXPECT_CONTINUATION_PROMPT,
      extra_init_cmd=None,
  ):
      if isinstance(cmd_or_spawn, basestring):
          self.child = pexpect.spawn(
              cmd_or_spawn, echo=False, encoding="utf-8"
          )
      else:
          self.child = cmd_or_spawn
      if self.child.echo:
          # Existing spawn instance has echo enabled, disable it
          # to prevent our input from being repeated to output.
          self.child.setecho(False)
          self.child.waitnoecho()
  
      if prompt_change is None:
          self.prompt = orig_prompt
      else:
          self.set_prompt(
              orig_prompt,
              prompt_change.format(new_prompt, continuation_prompt),
          )
          self.prompt = new_prompt
      self.continuation_prompt = continuation_prompt
  
      self._expect_prompt()
  
      if extra_init_cmd is not None:
          self.run_command(extra_init_cmd)
  
file_path: catboost/contrib/python/pexpect/py2/pexpect/replwrap.py
imports: import os.path
  import signal
  import sys
  import pexpect
label_desc: Use image node_id 1 to create a new REPLWrapper object from inherited base classes: object with example: obj = REPLWrapper(cmd_or_spawn, orig_prompt, prompt_change, new_prompt, continuation_prompt, extra_init_cmd)