class_docstr: 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)
      future, past = _generate_evaluation_dataset(
          self.gluonts(), cast(int, 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
  import shutil
  from dataclasses import dataclass, field
  from pathlib import Path
  from typing import cast, Dict, Tuple, Union
  import numpy
  import pandas
  from gluonts.dataset.common import Dataset, FileDataset, MetaData
  from numpy import ma
  from tsbench.constants import DEFAULT_DATA_CATCH22_PATH, DEFAULT_DATA_PATH, DEFAULT_DATA_STATS_PATH
label_desc: Use image node_id 3 for calling the DatasetSplit obj's underlying member method code with example usage: obj.prepare() without return types