code: def _get_debugger_cls():
      shell = get_ipython()
      if shell is None:
          # Not inside IPython
          # Build a terminal app in order to force ipython to load the
          # configuration
          ipapp = TerminalIPythonApp()
          # Avoid output (banner, prints)
          ipapp.interact = False
          ipapp.initialize(["--no-term-title"])
          shell = ipapp.shell
      else:
          # Running inside IPython
  
          # Detect if embed shell or not and display a message
          if isinstance(shell, InteractiveShellEmbed):
              sys.stderr.write(
                  "\nYou are currently into an embedded ipython shell,\n"
                  "the configuration will not be loaded.\n\n"
              )
  
      # Let IPython decide about which debugger class to use
      # This is especially important for tools that fiddle with stdout
      return shell.debugger_cls
  
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 1 for calling a global function with example usage: _get_debugger_cls() and returns: shell