docs: def embed2(**kwargs):
      """
      Modified from IPython.terminal.embed.embed so I can mess with stack_depth
      """
      config = kwargs.get('config')
      header = kwargs.pop('header', u'')
      stack_depth = kwargs.pop('stack_depth', 2)
      compile_flags = kwargs.pop('compile_flags', None)
      import IPython
      from IPython.core.interactiveshell import InteractiveShell
      from IPython.terminal.embed import InteractiveShellEmbed
      if config is None:
          config = IPython.terminal.ipapp.load_default_config()
          config.InteractiveShellEmbed = config.TerminalInteractiveShell
          kwargs['config'] = config
      #save ps1/ps2 if defined
      ps1 = None
      ps2 = None
      try:
          ps1 = sys.ps1
          ps2 = sys.ps2
      except AttributeError:
          pass
      #save previous instance
      saved_shell_instance = InteractiveShell._instance
      if saved_shell_instance is not None:
          cls = type(saved_shell_instance)
          cls.clear_instance()
      shell = InteractiveShellEmbed.instance(**kwargs)
      shell(header=header, stack_depth=stack_depth, compile_flags=compile_flags)
      InteractiveShellEmbed.clear_instance()
      #restore previous instance
      if saved_shell_instance is not None:
          cls = type(saved_shell_instance)
          cls.clear_instance()
          for subclass in cls._walk_mro():
              subclass._instance = saved_shell_instance
      if ps1 is not None:
          sys.ps1 = ps1
          sys.ps2 = ps2