code: def make_mock_estimator(
      estimator_class: BaseEstimator, method_regex: str = ".*"
  ) -> BaseEstimator:
      r"""Transform any estimator class into a mock estimator class.
  
      The returned class will accept the original arguments passed in estimator_class
      __init__ as a dictionary of kwargs.
  
      Parameters
      ----------
      estimator_class : BaseEstimator
          any sktime estimator
      method_regex : str, optional
          regex to filter methods on, by default ".*"
          Useful regex examples:
              - everything: '.*'
              - private methods only: '^(?!^__\w+__$)^_\w'
              - public methods only: '(?!^_\w+)'
  
      Returns
      -------
      BaseEstimator
          input estimator class with logging feature enabled
  
      Examples
      --------
      >>> from sktime.forecasting.naive import NaiveForecaster
      >>> from sktime.utils.estimators import make_mock_estimator
      >>> from sktime.datasets import load_airline
      >>> y = load_airline()
      >>> mock_estimator_class = make_mock_estimator(NaiveForecaster)
      >>> mock_estimator_instance = mock_estimator_class({"strategy": "last", "sp": 1})
      >>> mock_estimator_instance.fit(y)
      _MockEstimator(...)
      """
      dunder_methods_regex = r"^__\w+__$"
  
      class _MockEstimator(estimator_class, _MockEstimatorMixin):
          def __init__(self, estimator_kwargs=None):
              self.estimator_kwargs = estimator_kwargs
              if estimator_kwargs is not None:
                  super().__init__(**estimator_kwargs)
              else:
                  super().__init__()
  
      for attr_name in dir(estimator_class):
          attr = getattr(_MockEstimator, attr_name)
          # exclude dunder methods (e.g. __eq__, __class__ etc.) and non callables
          # from logging
          if not re.match(dunder_methods_regex, attr_name) and callable(
              attr
          ):
              # match the given regex pattern
              # exclude static and class methods from logging
              if (
                  re.match(method_regex, attr_name)
                  and "self" in getfullargspec(attr).args
              ):
                  setattr(
                      _MockEstimator, attr_name, _method_logger(attr)
                  )
  
      return _MockEstimator
  
file_path: sktime/sktime/utils/estimators/_base.py
imports: import re
  from copy import deepcopy
  from functools import wraps
  from inspect import getcallargs, getfullargspec
  from sktime.base import BaseEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: make_mock_estimator(estimator_class, method_regex) and returns: _MockEstimator