code: def _extract_dependency_from_error_msg(msg):
      # We raise an user-friendly error if a soft dependency is missing in the
      # `check_soft_dependencies` function. In the error message, the missing
      # dependency is printed in single quotation marks, so we can use that here to
      # extract and return the dependency name.
      match = re.search(r"\'(.+?)\'", msg)
      if match:
          return match.group(1)
      else:
          raise ValueError("No dependency found in error msg.")
  
imports: import pkgutil
  import re
  from importlib import import_module
  import pytest
  from sktime.registry import all_estimators
  from sktime.tests._config import EXCLUDE_ESTIMATORS
  from sktime.utils._testing.scenarios_getter import retrieve_scenarios
  from sktime.utils.validation._dependencies import _check_python_version, _check_soft_dependencies
label_desc: Use image node_id 4 for calling a global function with example usage: _extract_dependency_from_error_msg(msg) and returns: match