code: def __iter__(self):
      batch = []
      # Last batch will be dropped if drop_last is not set False
      for idx in range(self.consumed_samples, self.total_samples):
          batch.append(idx)
          if len(batch) == self._global_batch_size:
              # start_idx, end_idx = self.get_start_end_idx()
              indices = [
                  batch[i]
                  for i in range(
                      self.data_parallel_rank,
                      self._global_batch_size,
                      self.data_parallel_size,
                  )
              ]
              assert (
                  len(indices)
                  == self._global_batch_size_on_this_data_parallel_rank
              )
              yield indices
              # yield batch[start_idx:end_idx]
              batch = []
  
      # Check the last partial batch and see drop_last is set
      if len(batch) > 0 and not self.drop_last:
          # start_idx, end_idx = self.get_start_end_idx()
          indices = [
              batch[i]
              for i in range(
                  self.data_parallel_rank,
                  len(batch),
                  self.data_parallel_size,
              )
          ]
          if self.pad_samples_to_global_batch_size:
              num_pad = (
                  self._global_batch_size // self.data_parallel_size
                  - len(indices)
              )
              indices = indices + [-1] * num_pad
          yield indices
  
imports: import abc
  import warnings
  from typing import Tuple
  import torch
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 2 for calling the MegatronPretrainingBatchSampler obj's underlying member method code with example usage: obj.__iter__() without return types