class_docstr: A dataset split provides all the representations for a particular split (train/val/test) of a
  dataset.
class_docstr_tok: ["A","dataset","split","provides","all","the","representations","for","a","particular","split","(","train\/val\/test",")","of","a","dataset","."]
docstr: Prepares all required representations provided that the GluonTS dataset is already
  generated.
docstr_tok: ["Prepares","all","required","representations","provided","that","the","GluonTS","dataset","is","already","generated","."]
code: def prepare(self) -> None:
      """
      Prepares all required representations provided that the GluonTS dataset is already
      generated.
      """
      target = self._directory / "numpy" / self._split
      if self._split == "train":
          if target.exists():
              shutil.rmtree(target)
          return
  
      if target.exists():
          if (
              (target / "future_data.npy").exists()
              and (target / "past_data.npy").exists()
              and (target / "past_mask.npy").exists()
          ):
              return
          shutil.rmtree(target)
  
      target.mkdir(parents=True)
      # Evaluation dataset is not standardized
      future, past = _generate_evaluation_dataset(
          self.data(evaluation=True), self._metadata.prediction_length
      )
  
      np.save(target / "future_data.npy", future)
      np.save(target / "past_data.npy", past.data)
      np.save(target / "past_mask.npy", past.mask)
  
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 4 for calling the DatasetSplit obj's underlying member method code with example usage: obj.prepare() without return types