code: def _exec(obj):
      # exec on PyQt6, exec_ elsewhere.
      obj.exec() if hasattr(obj, "exec") else obj.exec_()
  
imports: import sys
  import os
  from IPython.external.qt_for_kernel import QtCore, QtGui, enum_helper
  from IPython import get_ipython
label_desc: Use image node_id 1 for calling a global function with example usage: _exec(obj) without return types