code: def _get_sample(self, idx):
      if self.respect_document_boundaries:
          start_index, end_index, seq_length = self.samples_mapping[idx]
          sample = []
          for index in range(start_index, end_index):
              sample.append(self.indexed_dataset[index])
      else:
          # Get the shuffled index.
          idx = self.shuffle_idx[idx]
          # Start and end documents and offsets.
          doc_index_f = self.sample_idx[idx][0]
          doc_index_l = self.sample_idx[idx + 1][0]
          offset_f = self.sample_idx[idx][1]
          offset_l = self.sample_idx[idx + 1][1]
          # If we are within the same document, just extract the chunk.
          if doc_index_f == doc_index_l:
              sample = self.indexed_dataset.get(
                  self.doc_idx[doc_index_f],
                  offset=offset_f,
                  length=offset_l - offset_f + 1,
              )
          else:
              # Otherwise, get the rest of the initial document.
              sample_list = [
                  self.indexed_dataset.get(
                      self.doc_idx[doc_index_f], offset=offset_f
                  )
              ]
              # Loop over all in between documents and add the entire document.
              for i in range(doc_index_f + 1, doc_index_l):
                  sample_list.append(
                      self.indexed_dataset.get(self.doc_idx[i])
                  )
              # And finally add the relevant portion of last document.
              sample_list.append(
                  self.indexed_dataset.get(
                      self.doc_idx[doc_index_l], length=offset_l + 1
                  )
              )
              sample = np.concatenate(sample_list)
              sample.astype(np.int64)
          seq_length = len(sample)
          sample = [sample]
  
      return sample, seq_length
  
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 4 for calling the T5Dataset obj's underlying member method code with example usage: obj._get_sample(idx) and returns: sample,  seq_length