code: def check_cuda_device(default_value):
      """
      wraps a function and returns the default value instead of running the
      wrapped function if cuda isn't available or the device is auto
      :param default_value:
      :return:
      """
  
      def deco(func):
          @functools.wraps(func)
          def wrapper(*args, **kwargs):
              device = kwargs.get("device", args[0] if args else None)
  
              if (
                  not torch.cuda.is_available()
                  or device == "auto"
                  or torch.device(device).type == "cpu"
              ):
                  return default_value
  
              return func(*args, **kwargs)
  
          return wrapper
  
      return deco
  
file_path: axolotl/src/axolotl/utils/bench.py
imports: import functools
  import pynvml
  import torch
  from pynvml.nvml import NVMLError
label_desc: Use image node_id 1 for calling a global function with example usage: check_cuda_device(default_value) and returns: deco, wrapper, func, default_value