code: def _repl_sh(command, args, non_printable_insert):
      child = pexpect.spawn(command, args, echo=False, encoding="utf-8")
  
      # If the user runs 'env', the value of PS1 will be in the output. To avoid
      # replwrap seeing that as the next prompt, we'll embed the marker characters
      # for invisible characters in the prompt; these show up when inspecting the
      # environment variable, but not when bash displays the prompt.
      ps1 = (
          PEXPECT_PROMPT[:5] + non_printable_insert + PEXPECT_PROMPT[5:]
      )
      ps2 = (
          PEXPECT_CONTINUATION_PROMPT[:5]
          + non_printable_insert
          + PEXPECT_CONTINUATION_PROMPT[5:]
      )
      prompt_change = "PS1='{0}' PS2='{1}' PROMPT_COMMAND=''".format(
          ps1, ps2
      )
  
      return REPLWrapper(
          child, "\\$", prompt_change, extra_init_cmd="export PAGER=cat"
      )
  
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 2 for calling a global function with example usage: _repl_sh(command, args, non_printable_insert) and returns: REPLWrapper