code: def test_ValueError_evaluate_grid_hyperparameters_multiseries_when_return_best_and_len_series_exog_different():
      """
      Test ValueError is raised in _evaluate_grid_hyperparameters_multiseries when
      `return_best = True` and length of `series` and `exog` do not match.
      """
      forecaster = ForecasterAutoregMultiSeries(
          regressor=Ridge(random_state=123), lags=3
      )
      exog = series.iloc[:30, 0]
  
      err_msg = re.escape(
          (
              f"`exog` must have same number of samples as `series`. "
              f"length `exog`: ({len(exog)}), length `series`: ({len(series)})"
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          _evaluate_grid_hyperparameters_multiseries(
              forecaster=forecaster,
              series=series,
              exog=exog,
              param_grid=[
                  {"alpha": 0.01},
                  {"alpha": 0.1},
                  {"alpha": 1},
              ],
              steps=4,
              metric="mean_absolute_error",
              initial_train_size=12,
              fixed_train_size=False,
              levels=None,
              lags_grid=[2, 4],
              refit=False,
              return_best=True,
              verbose=False,
          )
  
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 2 for calling a global function with example usage: test_ValueError_evaluate_grid_hyperparameters_multiseries_when_return_best_and_len_series_exog_different() without return types