code: def test_ValueError_evaluate_grid_hyperparameters_sarimax_when_return_best_and_len_y_exog_different():
      """
      Test ValueError is raised in _evaluate_grid_hyperparameters_sarimax when return_best
      and length of `y` and `exog` do not match.
      """
      forecaster = ForecasterSarimax(
          regressor=Sarimax(
              order=(3, 2, 0), maxiter=1000, method="cg", disp=False
          )
      )
      exog_test = exog_datetime[:30].copy()
  
      err_msg = re.escape(
          (
              f"`exog` must have same number of samples as `y`. "
              f"length `exog`: ({len(exog_test)}), length `y`: ({len(y_datetime)})"
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          _evaluate_grid_hyperparameters_sarimax(
              forecaster=forecaster,
              y=y_datetime,
              exog=exog_test,
              param_grid=[
                  {"order": (1, 1, 1)},
                  {"order": (1, 2, 2)},
                  {"order": (1, 2, 3)},
              ],
              steps=3,
              metric="mean_absolute_error",
              initial_train_size=len(y_datetime) - 12,
              fixed_train_size=False,
              refit=False,
              return_best=True,
              verbose=False,
          )
  
imports: import re
  import pytest
  import platform
  import numpy
  import pandas
  from sklearn.metrics import mean_absolute_error
  from pmdarima.arima import ARIMA
  from skforecast.Sarimax import Sarimax
  from skforecast.ForecasterSarimax import ForecasterSarimax
  from skforecast.model_selection_sarimax.model_selection_sarimax import _evaluate_grid_hyperparameters_sarimax
  from tqdm import tqdm
  from functools import partialmethod
  from ...ForecasterSarimax.tests.fixtures_ForecasterSarimax import y_datetime
  from ...ForecasterSarimax.tests.fixtures_ForecasterSarimax import exog_datetime
label_desc: Use image node_id 1 for calling a global function with example usage: test_ValueError_evaluate_grid_hyperparameters_sarimax_when_return_best_and_len_y_exog_different() without return types