code: def gpu_only_import(module, *, alt=None):
      """A function used to import modules required only in GPU installs
  
      This function will attempt to import a module with the given name, but it
      will only throw an ImportError if the attempt fails AND this is not a
      CPU-only build. This allows GPU-only dependencies to be cleanly
      imported in CPU-only builds but guarantees that the correct exception
      will be raised if a required dependency is unavailable. If the import
      fails on a CPU-only build and no alternate module is indicated via the
      keyword `alt` argument, a placeholder object will be returned which raises
      an exception only if used.
  
      Parameters
      ----------
      module: str
          The name of the module to import.
      alt: object
          An optional module to be used in place of the given module if it
          fails to import in a non-GPU-enabled install
  
      Returns
      -------
      object
          The imported module, the given alternate, or a class derived from
          UnavailableMeta.
      """
      if GPU_ENABLED:
          return importlib.import_module(module)
      else:
          return safe_import(
              module,
              msg=f"{module} is not installed in non GPU-enabled installations",
              alt=alt,
          )
  
imports: import importlib
  import traceback
  from contextlib import contextmanager
  from cuml.internals.device_support import CPU_ENABLED, GPU_ENABLED
  from cuml.internals import logger
label_desc: Use image node_id 6 for calling a global function with example usage: gpu_only_import(module) and returns: importlib, safe_import