code: def test_softdep_error(estimator):
      """Test that estimators raise error if required soft dependencies are missing."""
      softdeps, softdeps_alias = _get_soft_deps(estimator)
      if not _is_in_env(softdeps, softdeps_alias):
          try:
              estimator.create_test_instance()
          except ModuleNotFoundError as e:
              error_msg = str(e)
  
              if not is_soft_dep_missing_message(error_msg):
                  raise RuntimeError(
                      f"Estimator {estimator.__name__} has soft dependency requirements, "
                      f"{softdeps} according to tags, but does not raise an appropriate "
                      f"error message on __init__, when those requirements are unmet. "
                      f"Likely reason is that __init__ does not call super().__init__,"
                      f" or imports super().__init__ only after an attempted import."
                  ) from e
  
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 13 for calling a global function with example usage: test_softdep_error(estimator) without return types