code: def test_evaluate_model_vs_forecasts():
      dataset = [
          {
              "item_id": k,
              "start": pd.Period("2022-06-12", freq="D"),
              "target": np.random.normal(size=50),
          }
          for k in range(2)
      ]
  
      test_data = split(dataset, offset=-12)[1].generate_instances(
          prediction_length=3, windows=4
      )
  
      model = SeasonalNaivePredictor(
          prediction_length=3, season_length=1
      )
  
      forecasts = list(model.predict(test_data.input))
  
      for axis in [None, 0, 1, (0, 1)]:
          df1 = evaluate_forecasts(
              forecasts=forecasts,
              test_data=test_data,
              metrics=_test_metrics,
              axis=axis,
          )
          df2 = evaluate_model(
              model=model,
              test_data=test_data,
              metrics=_test_metrics,
              axis=axis,
          )
          assert (df1 == df2).all().all()
  
file_path: gluonts/test/model/test_evaluation.py
imports: from typing import List, Tuple, Union
  import numpy
  import pytest
  import pandas
  from gluonts.dataset.split import split, TestData
  from gluonts.itertools import prod
  from gluonts.model.seasonal_naive import SeasonalNaivePredictor
  from gluonts.model import SampleForecast, evaluate_forecasts, evaluate_model
  from gluonts.ev.metrics import MetricDefinition, MSE, RMSE, NRMSE, MAPE, SMAPE, MASE, MSIS, ND, WeightedSumQuantileLoss, MeanWeightedSumQuantileLoss, MeanScaledQuantileLoss, AverageMeanScaledQuantileLoss
label_desc: Use image node_id 3 for calling a global function with example usage: test_evaluate_model_vs_forecasts() without return types