code: def requires_module(*modules: str):
      """Decorate function to give error message if invoked without required optional modules.
  
      This decorator is to give better error message to users rather
      than raising ``NameError:  name 'module' is not defined`` at random places.
      """
      missing = [m for m in modules if not is_module_available(m)]
  
      if not missing:
          # fall through. If all the modules are available, no need to decorate
          def decorator(func):
              return func
  
      else:
          req = (
              f"module: {missing[0]}"
              if len(missing) == 1
              else f"modules: {missing}"
          )
  
          def decorator(func):
              @wraps(func)
              def wrapped(*args, **kwargs):
                  raise RuntimeError(
                      f"{func.__module__}.{func.__name__} requires {req}"
                  )
  
              return wrapped
  
      return decorator
  
file_path: audio/src/torchaudio/_internal/module_utils.py
imports: import importlib.util
  import os
  import warnings
  from functools import wraps
  from typing import Optional
label_desc: Use image node_id 3 for calling a global function with example usage: requires_module() and returns: decorator, func, wrapped