code: def debug_info(type, value, tb):
      if hasattr(sys, "ps1") or not sys.stderr.isatty():
          sys.__excepthook__(type, value, tb)
      else:
          import pdb
          import traceback
  
          traceback.print_exception(type, value, tb)
          print
          pdb.post_mortem(tb)
  
label_desc: Use image node_id 1 for calling a global function with example usage: debug_info(type, value, tb) without return types