code: def dumpstacks():
      import threading
      import traceback
  
      id2name = {th.ident: th.name for th in threading.enumerate()}
      code = []
      for threadId, stack in sys._current_frames().items():
          code.append(
              f"\n# Thread: {id2name.get(threadId, '')}({threadId})"
          )
          for filename, lineno, name, line in traceback.extract_stack(
              stack
          ):
              code.append(
                  f"""File: "{filename}", line {lineno}, in {name}"""
              )
              if line:
                  code.append("  " + line.strip())
  
      print("\n".join(code))
  
file_path: stable-diffusion-webui/modules/initialize_util.py
imports: import json
  import os
  import signal
  import sys
  import re
  from modules.timer import startup_timer
label_desc: Use image node_id 7 for calling a global function with example usage: dumpstacks() without return types