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.
class_docstr_tok: ["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.
      name: A specific dataset name. Should only be used for the cheat data module.
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",".","name",":","A","specific","dataset","name",".","Should","only","be","used","for","the","cheat","data","module","."]
code: def train(self, val: bool = True, name: str = "") -> 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.
          name: A specific dataset name. Should only be used for the cheat data module.
      """
      if val:
          split_name = f"train_{name}" if name else "train"
      else:
          split_name = f"val_{name}" if name else "val"
  
      return DatasetSplit(
          self._metadata,
          self._directory,
          split_name,
          self._dataset_name,
          _standardize=self._standardize,
      )
  
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 the DatasetSplits obj's underlying member method code with example usage: obj.train(val, name) and returns: DatasetSplit