class_docstr: Abstract class for TextMemmapSequenceToSequenceDataset and BinarizedMemmapSequenceToSequenceDataset.
  This class is not meant to be used standalone and just as an abstract class for the two subclasses.
class_docstr_tok: ["Abstract","class","for","TextMemmapSequenceToSequenceDataset","and","BinarizedMemmapSequenceToSequenceDataset",".","This","class","is","not","meant","to","be","used","standalone","and","just","as","an","abstract","class","for","the","two","subclasses","."]
code: def _build_samples_mapping(self):
      if self.max_num_samples is not None:
          # This means max src and max tgt sequence length need to be the same
          if self.max_src_seq_length != self.max_tgt_seq_length:
              raise ValueError(
                  f"max_src_seq_length ({self.max_src_seq_length}) != max_tgt_seq_length ({self.max_tgt_seq_length}). This is needed for max_samples based training for now."
              )
  
          self.samples_mapping = get_samples_mapping(
              indexed_dataset=self.src_indexed_dataset,
              data_prefix=self.src_file_name,
              num_epochs=None,
              max_num_samples=self.max_num_samples,
              max_seq_length=self.max_src_seq_length - 2,
              short_seq_prob=0,
              seed=self.seed,
              name=self.src_file_name.split("/")[-1],
              binary_head=False,
          )
      else:
          self.samples_mapping = None
  
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 5 for calling the IndexedSequenceToSequenceDataset obj's underlying member method code with example usage: obj._build_samples_mapping() without return types