code: def _excepthook(self, args, use_thread_hook):
      ## Start by extending recursion depth just a bit.
      ## If the error we are catching is due to recursion, we don't want to generate another one here.
      recursionLimit = sys.getrecursionlimit()
      try:
          sys.setrecursionlimit(recursionLimit + 100)
  
          ## call original exception handler first (prints exception)
          global callbacks, clear_tracebacks
          header = "===== %s =====" % str(
              time.strftime(
                  "%Y.%m.%d %H:%m:%S", time.localtime(time.time())
              )
          )
          try:
              print(header)
          except Exception:
              sys.stderr.write(
                  "Warning: stdout is broken! Falling back to stderr.\n"
              )
              sys.stdout = sys.stderr
  
          if use_thread_hook:
              ret = self.orig_threading_excepthook(args)
          else:
              ret = self.orig_sys_excepthook(
                  args.exc_type, args.exc_value, args.exc_traceback
              )
  
          for cb in callbacks:
              try:
                  cb(args)
              except Exception:
                  print(
                      "   --------------------------------------------------------------"
                  )
                  print(
                      "      Error occurred during exception callback %s"
                      % str(cb)
                  )
                  print(
                      "   --------------------------------------------------------------"
                  )
                  traceback.print_exception(*sys.exc_info())
  
          # deprecated callback style requiring 3 args
          for cb in old_callbacks:
              try:
                  cb(args.exc_type, args.exc_value, args.exc_traceback)
              except Exception:
                  print(
                      "   --------------------------------------------------------------"
                  )
                  print(
                      "      Error occurred during exception callback %s"
                      % str(cb)
                  )
                  print(
                      "   --------------------------------------------------------------"
                  )
                  traceback.print_exception(*sys.exc_info())
  
          ## Clear long-term storage of last traceback to prevent memory-hogging.
          ## (If an exception occurs while a lot of data is present on the stack,
          ## such as when loading large files, the data would ordinarily be kept
          ## until the next exception occurs. We would rather release this memory
          ## as soon as possible.)
          if clear_tracebacks is True:
              sys.last_traceback = None
  
          return ret
  
      finally:
          sys.setrecursionlimit(recursionLimit)
  
file_path: pyqtgraph/pyqtgraph/exceptionHandling.py
imports: import sys
  import threading
  import time
  import traceback
  from types import SimpleNamespace
label_desc: Use image node_id 5 for calling the ExceptionHandler obj's underlying member method code with example usage: obj._excepthook(args, use_thread_hook) and returns: ret