code: def test_NotFittedError_is_raised_when_forecaster_is_not_fitted():
      """
      Test NotFittedError is raised when calling get_feature_importances() and
      forecaster is not fitted.
      """
      forecaster = ForecasterAutoreg(
          regressor=LinearRegression(),
          lags=3,
      )
  
      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/ForecasterAutoreg/tests/test_get_feature_importances.py
imports: import re
  import pytest
  from pytest import approx
  import numpy
  import pandas
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from sklearn.exceptions import NotFittedError
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.linear_model import LinearRegression
  from sklearn.neural_network import MLPRegressor
  from sklearn.ensemble import RandomForestRegressor
label_desc: Use image node_id 1 for calling a global function with example usage: test_NotFittedError_is_raised_when_forecaster_is_not_fitted() without return types