code: def test_MASE_sMAPE_M4(timeseries, res):
      ts_datastructure = pd.Series
      evaluator = Evaluator(quantiles=QUANTILES)
      agg_df, item_df = calculate_metrics(
          timeseries, evaluator, ts_datastructure
      )
  
      assert (
          abs((agg_df["MASE"] - res["MASE"]) / res["MASE"]) < 0.001
      ), (
          "Scores for the metric MASE do not match: "
          "\nexpected: {} \nobtained: {}".format(
              res["MASE"], agg_df["MASE"]
          )
      )
      assert (
          abs((agg_df["MAPE"] - res["MAPE"]) / res["MAPE"]) < 0.001
      ), (
          "Scores for the metric MAPE do not match: \nexpected: {} "
          "\nobtained: {}".format(res["MAPE"], agg_df["MAPE"])
      )
      assert (
          abs((agg_df["sMAPE"] - res["sMAPE"]) / res["sMAPE"]) < 0.001
      ), (
          "Scores for the metric sMAPE do not match: \nexpected: {} "
          "\nobtained: {}".format(res["sMAPE"], agg_df["sMAPE"])
      )
      assert (
          sum(
              abs(
                  item_df["seasonal_error"].values
                  - res["seasonal_error"]
              )
          )
          < 0.001
      ), (
          "Scores for the metric seasonal_error do not match: \nexpected: {} "
          "\nobtained: {}".format(
              res["seasonal_error"], item_df["seasonal_error"].values
          )
      )
  
file_path: gluonts/test/evaluation/test_evaluator.py
imports: import numpy
  import pandas
  import pytest
  from gluonts.evaluation import Evaluator, MultivariateEvaluator, aggregate_valid
  from gluonts.model.forecast import QuantileForecast, SampleForecast
label_desc: Use image node_id 6 for calling a global function with example usage: test_MASE_sMAPE_M4(timeseries, res) without return types