parameters: (api)
docstring: Safely query whether an API is importable, without importing it
docstring_summary: Safely query whether an API is importable, without importing it
docstring_tokens: Safely query whether an API is importable without importing it
function: def can_import(api):
      """Safely query whether an API is importable, without importing it"""
      if not has_binding(api):
          return False
  
      current = loaded_api()
      if api == QT_API_PYQT_DEFAULT:
          return current in [QT_API_PYQT, QT_API_PYQTv1, None]
      else:
          return current in [api, None]
function_tokens: def can_import ( api ) : if not has_binding ( api ) : return False current = loaded_api ( ) if api == QT_API_PYQT_DEFAULT : return current in [ QT_API_PYQT , QT_API_PYQTv1 , None ] else : return current in [ api , None ]