code: def test_metrics_mp(timeseries, res, has_nans, input_type):
      ts_datastructure = pd.Series
      # Default will be multiprocessing evaluator
      evaluator = Evaluator(
          quantiles=QUANTILES, num_workers=4, allow_nan_forecast=True
      )
      agg_metrics, item_metrics = calculate_metrics(
          timeseries,
          evaluator,
          ts_datastructure,
          has_nans=has_nans,
          input_type=input_type,
      )
  
      for metric, score in agg_metrics.items():
          if metric in res.keys():
              assert np.isclose(score, res[metric], equal_nan=True), (
                  "Scores for the metric {} do not match: \nexpected: {} "
                  "\nobtained: {}".format(metric, res[metric], score)
              )
  
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 8 for calling a global function with example usage: test_metrics_mp(timeseries, res, has_nans, input_type) without return types