code: def test_NotFittedError_is_raised_when_forecaster_is_not_fitted(
      regressor,
  ):
      """
      Test NotFittedError is raised when calling get_feature_importances() and
      forecaster is not fitted.
      """
      forecaster = ForecasterSarimax(regressor=regressor)
  
      err_msg = re.escape(
          (
              "This forecaster is not fitted yet. Call `fit` with appropriate "
              "arguments before using `get_feature_importances()`."
          )
      )
      with pytest.raises(NotFittedError, match=err_msg):
          forecaster.get_feature_importances()
  
file_path: skforecast/skforecast/ForecasterSarimax/tests/test_get_feature_importances.py
imports: import re
  import pytest
  import numpy
  import pandas
  from pmdarima.arima import ARIMA
  from skforecast.Sarimax import Sarimax
  from skforecast.ForecasterSarimax import ForecasterSarimax
  from sklearn.exceptions import NotFittedError
  from .fixtures_ForecasterSarimax import y
  from .fixtures_ForecasterSarimax import exog
label_desc: Use image node_id 1 for calling a global function with example usage: test_NotFittedError_is_raised_when_forecaster_is_not_fitted(regressor) without return types