code: def post_mortem(tb=None):
      wrap_sys_excepthook()
      p = _init_pdb()
      p.reset()
      if tb is None:
          # sys.exc_info() returns (type, value, traceback) if an exception is
          # being handled, otherwise it returns None
          tb = sys.exc_info()[2]
      if tb:
          p.interaction(None, tb)
  
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 7 for calling a global function with example usage: post_mortem(tb) without return types