code: def test_autocomplete_map_func_dict(df2):
      """Tests autocomplete_map_func_dict function"""
      map_func_dict = {
          "residual": ElementwiseEvaluationMetricEnum.Residual.name,
          "squared_error": ElementwiseEvaluationMetricEnum.SquaredError.name,
          "coverage": ElementwiseEvaluationMetricEnum.Coverage.name,
          "custom_metric": lambda row: (
              row[cst.ACTUAL_COL] - row[cst.PREDICTED_COL]
          )
          ** 4,
      }
  
      df_renamed = df2.rename(
          {
              cst.TIME_COL: "custom_time_col",
              cst.ACTUAL_COL: "custom_actual_col",
              cst.PREDICTED_COL: "custom_predicted_col",
              cst.PREDICTED_LOWER_COL: "custom_predicted_lower_col",
              cst.PREDICTED_UPPER_COL: "custom_predicted_upper_col",
              cst.NULL_PREDICTED_COL: "custom_null_predicted_col",
          }
      )
  
      forecast = UnivariateForecast(
          df_renamed, train_end_date=datetime.datetime(2018, 1, 5)
      )
      map_func_dict = forecast.autocomplete_map_func_dict(map_func_dict)
  
      actual = df2.apply(map_func_dict["residual"], axis=1)
      expected = df2[cst.ACTUAL_COL] - df2[cst.PREDICTED_COL]
      assert_series_equal(actual, expected)
  
      actual = df2.apply(map_func_dict["squared_error"], axis=1)
      expected = (df2[cst.ACTUAL_COL] - df2[cst.PREDICTED_COL]).pow(2)
      assert_series_equal(actual, expected)
  
      actual = df2.apply(map_func_dict["coverage"], axis=1)
      expected = (
          (df2[cst.ACTUAL_COL] > df2[cst.PREDICTED_LOWER_COL])
          & (df2[cst.ACTUAL_COL] < df2[cst.PREDICTED_UPPER_COL])
      ).astype("float")
      assert_series_equal(actual, expected)
  
      actual = df2.apply(map_func_dict["custom_metric"], axis=1)
      expected = (df2[cst.ACTUAL_COL] - df2[cst.PREDICTED_COL]).pow(4)
      assert_series_equal(actual, expected)
  
      assert forecast.autocomplete_map_func_dict(None) is None
  
      valid_names = ", ".join(
          ElementwiseEvaluationMetricEnum.__dict__["_member_names_"]
      )
      with pytest.raises(
          ValueError,
          match=f"unknown_func is not a recognized elementwise "
          f"evaluation metric. Must be one of: {valid_names}",
      ):
          map_func_dict = {"unknown_func": "unknown_func"}
          forecast.autocomplete_map_func_dict(map_func_dict)
  
imports: import datetime
  import math
  import sys
  from functools import partial
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from pandas.testing import assert_series_equal
  from sklearn.pipeline import Pipeline
  from greykite.common import constants
  from greykite.common.evaluation import ElementwiseEvaluationMetricEnum
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import gen_sliced_df
  from greykite.framework.input.univariate_time_series import UnivariateTimeSeries
  from greykite.framework.output.univariate_forecast import UnivariateForecast
  from greykite.framework.pipeline.utils import get_forecast
  from greykite.sklearn.estimator.prophet_estimator import ProphetEstimator
  from greykite.sklearn.estimator.silverkite_estimator import SilverkiteEstimator
  from greykite.sklearn.estimator.testing_utils import params_component_breakdowns
label_desc: Use image node_id 14 for calling a global function with example usage: test_autocomplete_map_func_dict(df2) without return types