code: def test_evaluate_bayesian_search_optuna_multiseries_when_return_best_ForecasterAutoregMultiSeries(
      lags_grid,
  ):
      """
      Test forecaster is refitted when return_best=True in
      _bayesian_search_optuna_multiseries with ForecasterAutoregMultiSeries
      (mocked done in skforecast v0.12.0).
      """
      forecaster = ForecasterAutoregMultiSeries(
          regressor=Ridge(random_state=123), lags=2
      )
  
      steps = 3
      n_validation = 12
  
      def search_space(trial):
          search_space = {
              "alpha": trial.suggest_float("alpha", 1e-2, 1.0)
          }
  
          return search_space
  
      _bayesian_search_optuna_multiseries(
          forecaster=forecaster,
          series=series,
          steps=steps,
          lags_grid=lags_grid,
          search_space=search_space,
          metric="mean_absolute_error",
          refit=True,
          initial_train_size=len(series) - n_validation,
          fixed_train_size=True,
          n_trials=10,
          random_state=123,
          return_best=True,
          verbose=False,
      )
  
      expected_lags = np.array([1, 2])
      expected_alpha = 0.2345829390285611
  
      np.testing.assert_array_equal(forecaster.lags, expected_lags)
      assert expected_alpha == forecaster.regressor.alpha
  
imports: import re
  import pytest
  import numpy
  import pandas
  import sys
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.linear_model import Ridge
  from sklearn.metrics import mean_absolute_error
  from skforecast.ForecasterAutoregMultiSeries import ForecasterAutoregMultiSeries
  from skforecast.ForecasterAutoregMultiSeriesCustom import ForecasterAutoregMultiSeriesCustom
  from skforecast.model_selection_multiseries import backtesting_forecaster_multiseries
  from skforecast.model_selection_multiseries.model_selection_multiseries import _bayesian_search_optuna_multiseries
  import optuna
  from optuna.samplers import TPESampler
  from tqdm import tqdm
  from functools import partialmethod
  from .fixtures_model_selection_multiseries import series
label_desc: Use image node_id 11 for calling a global function with example usage: test_evaluate_bayesian_search_optuna_multiseries_when_return_best_ForecasterAutoregMultiSeries(lags_grid) and returns: search_space