code: def import_pyqt4(version=2):
      """
      Import PyQt4
  
      Parameters
      ----------
      version : 1, 2, or None
          Which QString/QVariant API to use. Set to None to use the system
          default
      ImportErrors raised within this function are non-recoverable
      """
      # The new-style string API (version=2) automatically
      # converts QStrings to Unicode Python strings. Also, automatically unpacks
      # QVariants to their underlying objects.
      import sip
  
      if version is not None:
          sip.setapi("QString", version)
          sip.setapi("QVariant", version)
  
      from PyQt4 import QtGui, QtCore, QtSvg
  
      if QtCore.PYQT_VERSION < 0x040700:
          raise ImportError(
              "IPython requires PyQt4 >= 4.7, found %s"
              % QtCore.PYQT_VERSION_STR
          )
  
      # Alias PyQt-specific functions for PySide compatibility.
      QtCore.Signal = QtCore.pyqtSignal
      QtCore.Slot = QtCore.pyqtSlot
  
      # query for the API version (in case version == None)
      version = sip.getapi("QString")
      api = QT_API_PYQTv1 if version == 1 else QT_API_PYQT
      return QtCore, QtGui, QtSvg, api
  
imports: import importlib.abc
  import sys
  import os
  import types
  from functools import partial, lru_cache
  import operator
label_desc: Use image node_id 6 for calling a global function with example usage: import_pyqt4(version) and returns: QtCore,  QtGui,  QtSvg,  api