code: def test_results_output_bayesian_search_skopt_ForecasterAutoregCustom_with_mocked():  # pragma: no cover
      """
      Test output of _bayesian_search_skopt in ForecasterAutoregCustom with mocked
      (mocked done in Skforecast v0.4.3).
      """
  
      def create_predictors(y):
          """
          Create first 4 lags of a time series, used in ForecasterAutoregCustom.
          """
  
          lags = y[-1:-5:-1]
  
          return lags
  
      forecaster = ForecasterAutoregCustom(
          regressor=Ridge(random_state=123),
          fun_predictors=create_predictors,
          window_size=4,
      )
  
      steps = 3
      n_validation = 12
      y_train = y[:-n_validation]
      search_space = {
          "alpha": Real(0.01, 1.0, "log-uniform", name="alpha")
      }
  
      results = _bayesian_search_skopt(
          forecaster=forecaster,
          y=y,
          search_space=search_space,
          steps=steps,
          metric="mean_absolute_error",
          refit=True,
          initial_train_size=len(y_train),
          fixed_train_size=True,
          n_trials=10,
          random_state=123,
          return_best=False,
          verbose=False,
      )[0]
  
      expected_results = pd.DataFrame(
          {
              "lags": [
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
                  "custom predictors",
              ],
              "params": [
                  {"alpha": 0.26663099972129245},
                  {"alpha": 0.07193526575307788},
                  {"alpha": 0.24086278856848584},
                  {"alpha": 0.27434725570656354},
                  {"alpha": 0.0959926247515687},
                  {"alpha": 0.3631244766604131},
                  {"alpha": 0.06635119445083354},
                  {"alpha": 0.14434062917737708},
                  {"alpha": 0.019050287104581624},
                  {"alpha": 0.0633920962590419},
              ],
              "mean_absolute_error": np.array(
                  [
                      0.21643005790510492,
                      0.21665565996188138,
                      0.2164646190462156,
                      0.21641953058020516,
                      0.21663365234334242,
                      0.2162939165190013,
                      0.21666043214039407,
                      0.21658325961136823,
                      0.21669499028423744,
                      0.21666290650172168,
                  ]
              ),
              "alpha": np.array(
                  [
                      0.26663099972129245,
                      0.07193526575307788,
                      0.24086278856848584,
                      0.27434725570656354,
                      0.0959926247515687,
                      0.3631244766604131,
                      0.06635119445083354,
                      0.14434062917737708,
                      0.019050287104581624,
                      0.0633920962590419,
                  ]
              ),
          },
          index=pd.RangeIndex(start=0, stop=10, step=1),
      ).sort_values(by="mean_absolute_error", ascending=True)
  
      pd.testing.assert_frame_equal(results, expected_results)
  
imports: import re
  import pytest
  import numpy
  import pandas
  import sys
  from pytest import approx
  from importlib import metadata
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.linear_model import Ridge
  from sklearn.metrics import mean_absolute_error
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.model_selection import backtesting_forecaster
  from .fixtures_model_selection import y
  from tqdm import tqdm
  from functools import partialmethod
label_desc: Use image node_id 6 for calling a global function with example usage: test_results_output_bayesian_search_skopt_ForecasterAutoregCustom_with_mocked() and returns: lags