code: def skip_if_no(package, min_version=None):
      """
      Generic function to help skip test functions when required packages are not
      present on the testing system.
  
      Intended for use as a decorator, this function will wrap the decorated
      function with a pytest ``skip_if`` mark. During a pytest test suite
      execution, that mark will attempt to import the specified ``package`` and
      optionally ensure it meets the ``min_version``. If the import and version
      check are unsuccessful, then the decorated function will be skipped.
  
      Parameters
      ----------
      package: str
          The name of the package required by the decorated function
      min_version: str or None, default None
          Optional minimum version of the package required by the decorated
          function
  
      Returns
      -------
      decorated_func: function
          The decorated function wrapped within a pytest ``skip_if`` mark
      """
  
      def decorated_func(func):
          msg = "Could not import '{}'".format(package)
          if min_version:
              msg += " satisfying a min_version of {}".format(
                  min_version
              )
          return pytest.mark.skipif(
              not safe_import(package, min_version=min_version),
              reason=msg,
          )(func)
  
      return decorated_func
  
file_path: catboost/contrib/python/pandas/py2/pandas/util/_test_decorators.py
imports: from distutils.version import LooseVersion
  import locale
  import pytest
  from pandas.compat import PY3, import_lzma, is_platform_32bit, is_platform_windows
  from pandas.compat.numpy import _np_version_under1p15
  from pandas.core.computation.expressions import _NUMEXPR_INSTALLED, _USE_NUMEXPR
label_desc: Use image node_id 8 for calling a global function with example usage: skip_if_no(package, min_version) and returns: decorated_func, pytest