code: def has_binding(api):
      """Safely check for PyQt4/5, PySide or PySide2, without importing submodules
  
      Parameters
      ----------
      api : str [ 'pyqtv1' | 'pyqt' | 'pyqt5' | 'pyside' | 'pyside2' | 'pyqtdefault']
          Which module to check for
  
      Returns
      -------
      True if the relevant module appears to be importable
      """
      module_name = api_to_module[api]
      from importlib.util import find_spec
  
      required = ["QtCore", "QtGui", "QtSvg"]
      if api in (
          QT_API_PYQT5,
          QT_API_PYSIDE2,
          QT_API_PYQT6,
          QT_API_PYSIDE6,
      ):
          # QT5 requires QtWidgets too
          required.append("QtWidgets")
  
      for submod in required:
          try:
              spec = find_spec("%s.%s" % (module_name, submod))
          except ImportError:
              # Package (e.g. PyQt5) not found
              return False
          else:
              if spec is None:
                  # Submodule (e.g. PyQt5.QtCore) not found
                  return False
  
      if api == QT_API_PYSIDE:
          # We can also safely check PySide version
          import PySide
  
          return PySide.__version_info__ >= (1, 0, 3)
  
      return True
  
imports: import importlib.abc
  import sys
  import os
  import types
  from functools import partial, lru_cache
  import operator
label_desc: Use image node_id 3 for calling a global function with example usage: has_binding(api) and returns: True, unknown, False, False