code: def test_output_get_feature_importances_when_regressor_is_RandomForest_with_exog():
      """
      Test output of get_feature_importances when regressor is RandomForestRegressor
      with create_predictors and it is trained with y=pd.Series(np.arange(10)) and
      a exogenous variable exog=pd.Series(np.arange(10, 20), name='exog').
      """
      forecaster = ForecasterAutoregCustom(
          regressor=RandomForestRegressor(
              n_estimators=1, max_depth=2, random_state=123
          ),
          fun_predictors=create_predictors,
          window_size=5,
      )
      forecaster.fit(
          y=pd.Series(np.arange(10)),
          exog=pd.Series(np.arange(10, 20), name="exog"),
      )
  
      results = forecaster.get_feature_importances()
      expected = pd.DataFrame(
          {
              "feature": [
                  "custom_predictor_0",
                  "custom_predictor_1",
                  "custom_predictor_2",
                  "custom_predictor_3",
                  "custom_predictor_4",
                  "exog",
              ],
              "importance": np.array(
                  [0.76190476, 0.0, 0.05952381, 0.17857143, 0.0, 0.0]
              ),
          }
      ).sort_values(by="importance", ascending=False)
  
      pd.testing.assert_frame_equal(results, expected)
  
imports: import re
  import pytest
  from pytest import approx
  import numpy
  import pandas
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  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 4 for calling a global function with example usage: test_output_get_feature_importances_when_regressor_is_RandomForest_with_exog() without return types