code: def requires(module_paths: Union[str, List]):
      if not isinstance(module_paths, list):
          module_paths = [module_paths]
  
      def decorator(func):
          @functools.wraps(func)
          def wrapper(*args: Any, **kwargs: Any):
              unavailable_modules = [
                  f"'{module}'"
                  for module in module_paths
                  if not module_available(module)
              ]
              if any(unavailable_modules):
                  is_lit_testing = bool(
                      int(os.getenv("LIGHTING_TESTING", "0"))
                  )
                  msg = f"Required dependencies not available. Please run: pip install {' '.join(unavailable_modules)}"
                  if is_lit_testing:
                      warnings.warn(msg)
                  else:
                      raise ModuleNotFoundError(msg)
              return func(*args, **kwargs)
  
          return wrapper
  
      return decorator
  
imports: import functools
  import os
  import platform
  import sys
  import warnings
  from typing import Any, List, Union
  from lightning_utilities.core.imports import module_available
  from packaging.requirements import Marker, Requirement
label_desc: Use image node_id 2 for calling a global function with example usage: requires(module_paths) and returns: decorator, wrapper, func