class_docstr: Sequence to Sequence Dataset in memory.
class_docstr_tok: ["Sequence","to","Sequence","Dataset","in","memory","."]
code: def __getitem__(self, idx):
      example = self.examples[idx]
      text_enc = example["src"]
      text_dec = example["tgt"][:-1]
      labels = example["tgt"][1:]
      return {
          "text_enc": text_enc,
          "text_dec": text_dec,
          "labels": labels,
      }
  
imports: import os
  import numpy
  import torch
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.data.language_modeling.megatron.dataset_utils import get_indexed_dataset_, get_samples_mapping
  from nemo.collections.nlp.data.language_modeling.text_memmap_dataset import TextMemMapDataset
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the SequenceToSequenceDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: dict