code: def has_xgboost():
      try:
          import xgboost  # NOQA
  
          return True
      except ImportError:
          return False
      except Exception as ex:
          import warnings
  
          warnings.warn(
              (
                  "The XGBoost library was found but raised an exception during "
                  "import. Importing xgboost will be skipped. "
                  "Error message:\n{}"
              ).format(str(ex))
          )
          return False
  
imports: import platform
  from cuml.internals.safe_imports import gpu_only_import, UnavailableError
  from distutils.version import LooseVersion
label_desc: Use image node_id 8 for calling a global function with example usage: has_xgboost() and returns: True, False, False