code: def test_against_former_evaluator():
      dataset = get_dataset("exchange_rate")
  
      prediction_length = dataset.metadata.prediction_length
      freq = dataset.metadata.freq
  
      _, test_template = split(
          dataset=dataset.test, offset=-prediction_length
      )
      test_data = test_template.generate_instances(
          prediction_length=prediction_length
      )
  
      predictor = SeasonalNaivePredictor(
          prediction_length=prediction_length,
          season_length=get_seasonality(freq),
      )
  
      quantile_levels = (0.1, 0.5, 0.9)
      ev_result = get_new_metrics(test_data, predictor, quantile_levels)
      evaluation_result = get_old_metrics(
          dataset.test, predictor, quantile_levels
      )
  
      for metric_name in ev_result.keys():
          np.testing.assert_allclose(
              ev_result[metric_name],
              evaluation_result[metric_name],
              err_msg=f"Metric '{metric_name}' is {ev_result[metric_name]} but "
              f"should be {evaluation_result[metric_name]}",
          )
  
imports: from copy import deepcopy
  from typing import ChainMap, Iterator, Optional, Union
  from dataclasses import dataclass
  import numpy
  from gluonts.dataset.repository import get_dataset
  from gluonts.dataset.split import TestData, split
  from gluonts.ext.naive_2 import naive_2
  from gluonts.time_feature.seasonality import get_seasonality
  from gluonts.model.forecast import Quantile, SampleForecast
  from gluonts.model.seasonal_naive import SeasonalNaivePredictor
  from gluonts.evaluation import Evaluator
  from gluonts.evaluation.backtest import make_evaluation_predictions
  from gluonts.ev import evaluate
  from gluonts.ev.ts_stats import seasonal_error
  from gluonts.ev.metrics import MAPE, MASE, MSE, MSIS, SMAPE, Coverage, SumAbsoluteError, SumQuantileLoss, mean_absolute_label, sum_absolute_label, ND, NRMSE, RMSE, MAECoverage, MeanSumQuantileLoss, MeanWeightedSumQuantileLoss, WeightedSumQuantileLoss, OWA
label_desc: Use image node_id 4 for calling a global function with example usage: test_against_former_evaluator() without return types