code: def _check_fitted(func):
      """
      This decorator checks if the model is fitted before using the desired method.
  
      Parameters
      ----------
      func : Callable
          Function to wrap.
  
      Returns
      -------
      wrapper : wrapper
          Function wrapped.
  
      """
  
      def wrapper(self, *args, **kwargs):
          if not self.fitted:
              raise NotFittedError(
                  (
                      "Sarimax instance is not fitted yet. Call `fit` with "
                      "appropriate arguments before using this method."
                  )
              )
  
          result = func(self, *args, **kwargs)
  
          return result
  
      return wrapper
  
imports: from typing import Union, Dict, List, Tuple, Any, Optional
  import warnings
  import logging
  import inspect
  import numpy
  import pandas
  from sklearn.base import clone, BaseEstimator, RegressorMixin
  from sklearn.exceptions import NotFittedError
  from statsmodels.tsa.statespace.sarimax import SARIMAX
  import skforecast
label_desc: Use image node_id 1 for calling a global function with example usage: _check_fitted(func) and returns: wrapper, result