code: def test_evaluation_shape(
      metrics: List[MetricDefinition],
      test_data: TestData,
      axis: Union[int, Tuple[int]],
  ):
      num_samples = 31
  
      sample_forecasts = [
          SampleForecast(
              samples=np.zeros((num_samples, *label["target"].T.shape)),
              start_date=label["start"],
              item_id=label["item_id"],
          )
          for label in test_data.label
      ]
  
      metrics_df = evaluate_forecasts(
          sample_forecasts,
          test_data=test_data,
          metrics=metrics,
          axis=axis,
      )
  
      assert metrics_df.shape == infer_metrics_df_shape(
          metrics, test_data, axis
      )
  
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 2 for calling a global function with example usage: test_evaluation_shape(metrics, test_data, axis) without return types