code: def test_python_error(estimator):
      """Test that estimators raise error if python version is wrong."""
      try:
          estimator.create_test_instance()
      except ModuleNotFoundError as e:
          error_msg = str(e)
  
          # Check if appropriate exception with useful error message is raised as
          # defined in the `_check_python` function
          expected_error_msg = "requires python version to be"
          if expected_error_msg not in error_msg:
              pyspec = estimator.get_class_tag("python_version", None)
              raise RuntimeError(
                  f"Estimator {estimator.__name__} has python version bound "
                  f"{pyspec} according to tags, but does not raise an appropriate "
                  f"error message on __init__ for incompatible python environments. "
                  f"Likely reason is that __init__ does not call super().__init__."
              ) 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 12 for calling a global function with example usage: test_python_error(estimator) without return types