code: def _init_pdb(context=None, commands=[]):
      if context is None:
          context = os.getenv(
              "IPDB_CONTEXT_SIZE", get_context_from_config()
          )
      debugger_cls = _get_debugger_cls()
      try:
          p = debugger_cls(context=context)
      except TypeError:
          p = debugger_cls()
      p.rcLines.extend(commands)
      return p
  
imports: from __future__ import print_function
  import os
  import sys
  from decorator import contextmanager
  from IPython import get_ipython
  from IPython.core.debugger import BdbQuit_excepthook
  from IPython.terminal.ipapp import TerminalIPythonApp
  from IPython.terminal.embed import InteractiveShellEmbed
label_desc: Use image node_id 2 for calling a global function with example usage: _init_pdb(context, commands) and returns: p