code: def skip_if_no_gpu(func):
      """Decorator that can be used to skip GPU tests on non-GPU machines."""
      func.skip_if_no_gpu = True
  
      @wraps(func)
      def wrapper(*args, **kwargs):
          if not torch.cuda.is_available():
              return
          if torch.cuda.device_count() <= 0:
              return
  
          return func(*args, **kwargs)
  
      return wrapper
  
imports: import os
  import unittest
  from functools import wraps
  import torch
  from classy_vision.hooks import ClassyHook
  from classy_vision.tasks import ClassyTask
  from classy_vision.trainer import ClassyTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: skip_if_no_gpu(func) and returns: wrapper, func