code: def crashtest():
      global allWidgets
      try:
          gc.disable()
          actions = [
              createWidget,
              # setParent,
              forgetWidget,
              showWidget,
              processEvents,
              # raiseException,
              # addReference,
          ]
  
          thread = WorkThread()
          thread.start()
  
          while True:
              try:
                  action = randItem(actions)
                  action()
                  print(
                      "[%d widgets alive, %d zombie]"
                      % (
                          len(allWidgets),
                          len(allWidgets) - len(widgets),
                      )
                  )
              except KeyboardInterrupt:
                  print("Caught interrupt; send another to exit.")
                  try:
                      for _ in range(100):
                          QtTest.QTest.qWait(100)
                  except KeyboardInterrupt:
                      thread.terminate()
                      break
              except:
                  sys.excepthook(*sys.exc_info())
      finally:
          gc.enable()
  
imports: import gc
  import sys
  import weakref
  from random import randint, seed
  import pyqtgraph
  from pyqtgraph.Qt import QtTest
label_desc: Use image node_id 1 for calling a global function with example usage: crashtest() without return types