code: def evaluate_forecasts_raw(
      forecasts: Iterable[Forecast],
      *,
      test_data: TestData,
      metrics,
      axis: Optional[Union[int, tuple]] = None,
      batch_size: int = 100,
      mask_invalid_label: bool = True,
      allow_nan_forecast: bool = False,
      seasonality: Optional[int] = None,
  ) -> dict:
      """
      Evaluate ``forecasts`` by comparing them with ``test_data``, according
      to ``metrics``.
  
      .. note:: This feature is experimental and may be subject to changes.
  
      The optional ``axis`` arguments controls aggregation of the metrics:
      - ``None`` (default) aggregates across all dimensions
      - ``0`` aggregates across the dataset
      - ``1`` aggregates across the first data dimension (time, in the univariate setting)
      - ``2`` aggregates across the second data dimension (time, in the multivariate setting)
  
      Return results as a dictionary.
      """
      label_ndim = first(test_data.label)["target"].ndim
  
      assert label_ndim in [1, 2]
  
      if axis is None:
          axis = tuple(range(label_ndim + 1))
      if isinstance(axis, int):
          axis = (axis,)
  
      assert all(ax in range(3) for ax in axis)
  
      evaluators = {}
      for metric in metrics:
          evaluator = metric(axis=axis)
          evaluators[evaluator.name] = evaluator
  
      index_data = []
  
      input_batches = batcher(test_data.input, batch_size=batch_size)
      label_batches = batcher(test_data.label, batch_size=batch_size)
      forecast_batches = batcher(forecasts, batch_size=batch_size)
  
      pbar = tqdm()
      for input_batch, label_batch, forecast_batch in zip(
          input_batches, label_batches, forecast_batches
      ):
          if 0 not in axis:
              index_data.extend(
                  [
                      (forecast.item_id, forecast.start_date)
                      for forecast in forecast_batch
                  ]
              )
  
          data_batch = _get_data_batch(
              input_batch,
              label_batch,
              forecast_batch,
              seasonality=seasonality,
              mask_invalid_label=mask_invalid_label,
              allow_nan_forecast=allow_nan_forecast,
          )
  
          for evaluator in evaluators.values():
              evaluator.update(data_batch)
  
          pbar.update(len(forecast_batch))
      pbar.close()
  
      metrics_values = {
          metric_name: evaluator.get()
          for metric_name, evaluator in evaluators.items()
      }
  
      if index_data:
          metrics_values["__index_0"] = index_data
  
      return metrics_values
  
imports: import logging
  from collections import ChainMap
  from typing import Iterable, List, Optional, Union
  from dataclasses import dataclass
  from toolz import first, valmap
  import numpy
  import pandas
  from tqdm import tqdm
  from gluonts.dataset import DataEntry
  from gluonts.dataset.split import TestData
  from gluonts.ev.ts_stats import seasonal_error
  from gluonts.itertools import batcher, prod
  from gluonts.model import Forecast, Predictor
  from gluonts.time_feature.seasonality import get_seasonality
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate_forecasts_raw(forecasts) and returns: metrics_values