code: def _requires(package_name):
      """Marks a method or class that _requires an optional dependency."""
  
      def f(func):
          @wraps(func)
          def g(*args, **kwargs):
              if not _compat.check_install(package_name):
                  raise ImportError(
                      f"{package_name} required to use this feature."
                  )
              _compat[
                  package_name
              ]  # Run any side imports, if applicable
              return func(*args, **kwargs)
  
          return g
  
      return f
  
file_path: data-describe/data_describe/compat/_dependency.py
imports: from importlib.util import find_spec
  from importlib import import_module
  import warnings
  from functools import wraps
  from types import ModuleType
  from typing import Dict, Callable, List
  from data_describe.misc.logging import OutputLogger
  from data_describe.compat._notebook import _check_plotly_extension
label_desc: Use image node_id 4 for calling a global function with example usage: _requires(package_name) and returns: f, g, func