code: def test_predict_NotFittedError_when_fitted_is_False():
      """
      Test NotFittedError is raised when fitted is False.
      """
      forecaster = ForecasterAutoregDirect(
          LinearRegression(), lags=3, steps=5
      )
  
      err_msg = re.escape(
          (
              "This Forecaster instance is not fitted yet. Call `fit` with "
              "appropriate arguments before using predict."
          )
      )
      with pytest.raises(NotFittedError, match=err_msg):
          forecaster.predict(steps=5)
  
imports: import re
  import pytest
  import numpy
  import pandas
  from sklearn.exceptions import NotFittedError
  from skforecast.ForecasterAutoregDirect import ForecasterAutoregDirect
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import StandardScaler
  from sklearn.preprocessing import OneHotEncoder
  from sklearn.preprocessing import OrdinalEncoder
  from sklearn.preprocessing import FunctionTransformer
  from sklearn.compose import make_column_transformer
  from sklearn.compose import make_column_selector
  from sklearn.pipeline import make_pipeline
  from sklearn.linear_model import LinearRegression
  from sklearn.ensemble import HistGradientBoostingRegressor
  from lightgbm import LGBMRegressor
  from .fixtures_ForecasterAutoregDirect import y
  from .fixtures_ForecasterAutoregDirect import exog
label_desc: Use image node_id 2 for calling a global function with example usage: test_predict_NotFittedError_when_fitted_is_False() without return types