code: def __init__(
      self,
      cfg,
      trainer,
      tokenizer,
      name,
      indexed_dataset,
      data_prefix,
      num_epochs,
      max_num_samples,
      max_seq_length,
      max_seq_length_dec,
      seed,
      masked_lm_prob=0.15,
      short_seq_prob=0.1,
      max_ngram_size=10,
      mean_ngram_size=None,
      geometric_dist=True,
      permutation=False,
      whole_word_masking=True,
      favor_long_ngrams=False,
      respect_document_boundaries=True,
      documents=None,
  ):
      super().__init__()
      # Params to store.
      self.name = name
      self.seed = seed
      self.masked_lm_prob = masked_lm_prob
      self.max_seq_length = max_seq_length
      self.max_seq_length_dec = max_seq_length_dec
      self.short_seq_prob = short_seq_prob
      self.max_ngram_size = max_ngram_size
      self.mean_ngram_size = mean_ngram_size
      self.geometric_dist = geometric_dist
      self.permutation = permutation
      self.whole_word_masking = whole_word_masking
      self.favor_long_ngrams = favor_long_ngrams
      self.respect_document_boundaries = respect_document_boundaries
  
      # Dataset.
      self.indexed_dataset = indexed_dataset
  
      # save index mappings to a configurable dir
      self.index_mapping_dir = cfg.data.get("index_mapping_dir", None)
  
      # create index_mapping_dir on rank 0
      if (
          torch.distributed.is_available()
          and torch.distributed.is_initialized()
      ):
          if torch.distributed.get_rank() == 0:
              if (
                  self.index_mapping_dir is not None
                  and not os.path.isdir(self.index_mapping_dir)
              ):
                  os.makedirs(self.index_mapping_dir)
          torch.distributed.barrier()
  
      # Build the samples mapping.
      if not respect_document_boundaries:
          # Build index mappings.
          assert documents is not None
          assert np.min(documents) >= 0
          assert np.max(documents) < indexed_dataset.sizes.shape[0]
  
          (
              self.doc_idx,
              self.sample_idx,
              self.shuffle_idx,
          ) = _build_index_mappings(
              name=self.name,
              data_prefix=data_prefix,
              documents=documents,
              sizes=self.indexed_dataset.sizes,
              num_samples=max_num_samples,
              seq_length=self.max_seq_length
              - self.MAX_SEQ_LENGTH_DELTA,
              seed=self.seed,
              index_mapping_dir=self.index_mapping_dir,
          )
      else:
          self.samples_mapping = get_samples_mapping(
              indexed_dataset=self.indexed_dataset,
              data_prefix=data_prefix,
              num_epochs=num_epochs,
              max_num_samples=max_num_samples,
              max_seq_length=self.max_seq_length
              - self.MAX_SEQ_LENGTH_DELTA,  # account for added tokens
              short_seq_prob=self.short_seq_prob,
              seed=self.seed,
              name=self.name,
              binary_head=False,
              index_mapping_dir=self.index_mapping_dir,
          )
  
      self.tokenizer = tokenizer
      self.tokenizer_type = T5Dataset._determine_tokenizer_type(
          tokenizer, whole_word_masking=whole_word_masking
      )
      self.cls_id = tokenizer.cls_id
      self.sep_id = tokenizer.sep_id
      self.mask_id = tokenizer.mask_id
      self.pad_id = tokenizer.pad_id
      self.bos_id = tokenizer.bos_id
      self.eos_id = tokenizer.eos_id
  
      self.vocab_id_list = self.tokenizer.vocab
      self.vocab_id_to_token_dict = {
          idx: token for idx, token in enumerate(self.vocab_id_list)
      }
  
      self._build()
  
imports: import collections
  import os
  import numpy
  import torch
  from nemo.collections.common.tokenizers import SentencePieceTokenizer, YouTokenToMeTokenizer
  from nemo.collections.nlp.data.language_modeling.megatron.dataset_utils import create_masked_lm_predictions, get_samples_mapping
  from nemo.collections.nlp.data.language_modeling.megatron.gpt_dataset import _build_index_mappings
  from nemo.core import Dataset
label_desc: Use image node_id 1 to create a new T5Dataset object from inherited base classes: Dataset with example: obj = T5Dataset(cfg, trainer, tokenizer, name, indexed_dataset, data_prefix, num_epochs, max_num_samples, max_seq_length, max_seq_length_dec, seed, masked_lm_prob, short_seq_prob, max_ngram_size, mean_ngram_size, geometric_dist, permutation, whole_word_masking, favor_long_ngrams, respect_document_boundaries, documents)