code: def test_exception_evaluate_grid_hyperparameters_sarimax_metric_list_duplicate_names():
      """
      Test exception is raised in _evaluate_grid_hyperparameters_sarimax when a `list` of
      metrics is used with duplicate names.
      """
      forecaster = ForecasterSarimax(
          regressor=Sarimax(
              order=(3, 2, 0), maxiter=1000, method="cg", disp=False
          )
      )
  
      err_msg = re.escape(
          "When `metric` is a `list`, each metric name must be unique."
      )
      with pytest.raises(ValueError, match=err_msg):
          _evaluate_grid_hyperparameters_sarimax(
              forecaster=forecaster,
              y=y_datetime,
              exog=exog_datetime,
              param_grid=[
                  {"order": (1, 1, 1)},
                  {"order": (1, 2, 2)},
                  {"order": (1, 2, 3)},
              ],
              steps=3,
              metric=["mean_absolute_error", 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 2 for calling a global function with example usage: test_exception_evaluate_grid_hyperparameters_sarimax_metric_list_duplicate_names() without return types