code: def test_autocomplete_metric_dict(valid_bm, metric_dict):
      bm = valid_bm
      updated_metric_dict = bm.autocomplete_metric_dict(
          metric_dict=metric_dict, enum_class=EvaluationMetricEnum
      )
      assert_equal(
          list(metric_dict.keys()), list(updated_metric_dict.keys())
      )
  
      invalid_metric_dict = {
          "corr": EvaluationMetricEnum.Correlation,
          "invalid_metric": 5,
      }
      enum_class = EvaluationMetricEnum
      with pytest.raises(
          ValueError,
          match="Value of 'invalid_metric' should be a callable or "
          f"a member of {enum_class}.",
      ):
          bm.autocomplete_metric_dict(
              metric_dict=invalid_metric_dict,
              enum_class=EvaluationMetricEnum,
          )
  
imports: import pickle
  import sys
  import numpy
  import pandas
  import pytest
  from plotly.colors import DEFAULT_PLOTLY_COLORS
  from greykite.algo.forecast.silverkite.constants.silverkite_holiday import SilverkiteHoliday
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import root_mean_squared_error
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
  from greykite.framework.benchmark.benchmark_class import BenchmarkForecastConfig
  from greykite.framework.constants import FORECAST_STEP_COL
  from greykite.framework.templates.autogen.forecast_config import ComputationParam
  from greykite.framework.templates.autogen.forecast_config import EvaluationMetricParam
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.templates.model_templates import ModelTemplateEnum
  from greykite.sklearn.cross_validation import RollingTimeSeriesSplit
label_desc: Use image node_id 19 for calling a global function with example usage: test_autocomplete_metric_dict(valid_bm, metric_dict) without return types