code: def make_multivariate_dataset(
      dataset_name: str,
      num_test_dates: int,
      prediction_length: int,
      max_target_dim: int = None,
      dataset_benchmark_name: str = None,
  ):
      """
      :param dataset_name:
      :param num_test_dates:
      :param prediction_length:
      :param max_target_dim:
      :param dataset_benchmark_name: in case the name is different in the repo and in the benchmark, for instance
      'wiki-rolling' and 'wikipedia'
      :return:
      """
  
      extract_dataset(dataset_name=dataset_name)
  
      metadata, train_ds, test_ds = load_datasets(
          metadata=default_dataset_path / dataset_name,
          train=default_dataset_path / dataset_name / "train",
          test=default_dataset_path / dataset_name / "test",
      )
      dim = len(train_ds) if max_target_dim is None else max_target_dim
      from multivariate.datasets.grouper import Grouper
  
      grouper_train = Grouper(max_target_dim=dim)
      grouper_test = Grouper(
          align_data=False,
          num_test_dates=num_test_dates,
          max_target_dim=dim,
      )
      return MultivariateDatasetInfo(
          dataset_name
          if dataset_benchmark_name is None
          else dataset_benchmark_name,
          grouper_train(train_ds),
          grouper_test(test_ds),
          prediction_length,
          # metadata.time_granularity,
          metadata.freq,
          dim,
      )
  
imports: from collections import OrderedDict
  import numpy
  import os
  import logging
  from typing import NamedTuple
  import pandas
  from pathlib import Path
  import tarfile
  from gluonts.dataset.common import Dataset, load_datasets
  from gluonts.dataset.repository import default_dataset_path
label_desc: Use image node_id 4 for calling a global function with example usage: make_multivariate_dataset(dataset_name, num_test_dates, prediction_length, max_target_dim, dataset_benchmark_name) and returns: MultivariateDatasetInfo