code: def test_evaluate_grid_hyperparameters_multiseries_when_return_best_ForecasterAutoregMultiSeries(
      lags_grid,
  ):
      """
      Test forecaster is refitted when `return_best = True` in
      _evaluate_grid_hyperparameters_multiseries.
      """
      forecaster = ForecasterAutoregMultiSeries(
          regressor=Ridge(random_state=123),
          lags=2,
          transformer_series=None,
      )
  
      steps = 3
      n_validation = 12
      param_grid = [{"alpha": 0.01}, {"alpha": 0.1}, {"alpha": 1}]
  
      _evaluate_grid_hyperparameters_multiseries(
          forecaster=forecaster,
          series=series,
          param_grid=param_grid,
          steps=steps,
          metric="mean_absolute_error",
          initial_train_size=len(series) - n_validation,
          fixed_train_size=False,
          levels=None,
          exog=None,
          lags_grid=lags_grid,
          refit=False,
          return_best=True,
          verbose=False,
      )
  
      expected_lags = np.array([1, 2, 3, 4])
      expected_alpha = 0.01
      expected_series_col_names = ["l1", "l2"]
  
      assert (expected_lags == forecaster.lags).all()
      assert expected_alpha == forecaster.regressor.alpha
      assert expected_series_col_names == forecaster.series_col_names
  
imports: import re
  import pytest
  import numpy
  import pandas
  from sklearn.linear_model import Ridge
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from skforecast.ForecasterAutoregMultiSeries import ForecasterAutoregMultiSeries
  from skforecast.ForecasterAutoregMultiSeriesCustom import ForecasterAutoregMultiSeriesCustom
  from skforecast.ForecasterAutoregMultiVariate import ForecasterAutoregMultiVariate
  from skforecast.model_selection_multiseries.model_selection_multiseries import _evaluate_grid_hyperparameters_multiseries
  from tqdm import tqdm
  from functools import partialmethod
  from .fixtures_model_selection_multiseries import series
label_desc: Use image node_id 9 for calling a global function with example usage: test_evaluate_grid_hyperparameters_multiseries_when_return_best_ForecasterAutoregMultiSeries(lags_grid) without return types