class_docstr: This class allows to drop you into an interactive debugger
  if there is an unhandled exception in your python script
  
  Example of usage:
  
  def main():
      # your code here
      pass
  
  if __name__ == '__main__':
      from caffe2.python.utils import DebugMode
      DebugMode.run(main)
class_docstr_tok: ["This","class","allows","to","drop","you","into","an","interactive","debugger","if","there","is","an","unhandled","exception","in","your","python","script","Example","of","usage",":","def","main","(",")",":","#","your","code","here","pass","if","__name__","==","'__main__","'",":","from","caffe2.python.utils","import","DebugMode","DebugMode.run","(","main",")"]
code: def run(cls, func):
      try:
          return func()
      except KeyboardInterrupt:
          raise
      except Exception:
          import pdb
  
          print(
              'Entering interactive debugger. Type "bt" to print '
              'the full stacktrace. Type "help" to see command listing.'
          )
          print(sys.exc_info()[1])
          print
  
          pdb.post_mortem()
          sys.exit(1)
          raise
  
imports: from caffe2.proto import caffe2_pb2
  from google.protobuf.message import DecodeError, Message
  from google.protobuf import text_format
  import sys
  import collections
  import copy
  import functools
  import numpy
label_desc: Use image node_id 1 for calling the DebugMode obj's underlying member method code with example usage: obj.run(cls, func) and returns: func