class_docstr: The dataset splits provide train, validation and test data for a particular
  dataset.
  
  Calling any of the functions here, is a noop. Data is only loaded once a
  particular representation of the data is accessed.
docstr: Returns the train data for the dataset.
  
  Args:
      val: Whether validation data is used. If not, this returns the validation data, i.e.
          the same time series that are longer by the prediction length.
docstr_tok: ["Returns","the","train","data","for","the","dataset",".","Args",":","val",":","Whether","validation","data","is","used",".","If","not",",","this","returns","the","validation","data",",","i.e",".","the","same","time","series","that","are","longer","by","the","prediction","length","."]
code: def train(self, val: bool = True) -> DatasetSplit:
      """
      Returns the train data for the dataset.
  
      Args:
          val: Whether validation data is used. If not, this returns the validation data, i.e.
              the same time series that are longer by the prediction length.
      """
      return DatasetSplit(
          self._metadata, self._directory, "train" if val else "val"
      )
  
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 1 for calling the DatasetSplits obj's underlying member method code with example usage: obj.train(val) and returns: DatasetSplit