code: def _generate_evaluation_dataset(
      dataset: TimeSeriesDataset, prediction_length: int
  ) -> Tuple[np.ndarray, ma.MaskedArray]:
      # Extract data from all the values in the dataset
      pasts = []
      past_lengths = []
      predictions = []
      for item in dataset:
          target = tensor_to_np(item.values).squeeze()
          pasts.append(target[:-prediction_length])
          past_lengths.append(target.shape[0] - prediction_length)
          predictions.append(target[-prediction_length:])
  
      # Compute masked past values as well as (non-masked) future values
      max_len = np.max(past_lengths)
      values = np.empty((len(dataset), max_len))
      mask = np.ones((len(dataset), max_len), dtype=bool)
      for i in range(len(dataset)):
          values[i, : past_lengths[i]] = pasts[i]
          mask[i, : past_lengths[i]] = False
  
      y_past = ma.masked_array(values, mask=mask)
      y_true = np.stack(predictions)
      return y_true, y_past
  
imports: from __future__ import annotations
  import json
  from dataclasses import dataclass
  from typing import Tuple, Optional, List
  from pathlib import Path
  from gluonts.dataset.common import FileDataset, MetaData
  from gluonts.dataset.field_names import FieldName
  import torch
  import numpy
  import numpy.ma
  import shutil
  from meta.data.dataset import TimeSeries, TimeSeriesDataset
  from meta.common import tensor_to_np
label_desc: Use image node_id 1 for calling a global function with example usage: _generate_evaluation_dataset(dataset, prediction_length) and returns: y_true,  y_past