code: def is_event_loop_running_qt4(app=None):
      """Is the qt4 event loop running."""
      # New way: check attribute on shell instance
      ip = get_ipython()
      if ip is not None:
          return ip.active_eventloop and ip.active_eventloop.startswith(
              "qt"
          )
  
      # Old way: check attribute on QApplication singleton
      if app is None:
          app = get_app_qt4([""])
      if hasattr(app, "_in_event_loop"):
          return app._in_event_loop
      else:
          # Does qt4 provide a other way to detect this?
          return False
  
imports: from IPython.core.getipython import get_ipython
label_desc: Use image node_id 5 for calling a global function with example usage: is_event_loop_running_qt4(app) and returns: unknown, app, False