code: def _method_logger(method):
      """Log the method and it's arguments."""
  
      @wraps(wrapped=method)
      def wrapper(self, *args, **kwargs):
          args_dict = getcallargs(method, self, *args, **kwargs)
          if not isinstance(self, _MockEstimatorMixin):
              raise TypeError(
                  "method_logger requires a MockEstimator class"
              )
          args_dict.pop("self")
          self.add_log_item((method.__name__, deepcopy(args_dict)))
          return method(self, *args, **kwargs)
  
      return wrapper
  
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 1 for calling a global function with example usage: _method_logger(method) and returns: wrapper, method