class_docstr: Lazy copy-paste from https://gist.github.com/MFreidank/821cc87b012c53fade03b0c7aba13958.
code: def __next__(self):
      try:
          batch = next(self.dataset_iterator)
      except StopIteration:
          # Dataset exhausted, use a new fresh iterator.
          self.dataset_iterator = super().__iter__()
          self.epoch_counter += 1
          if hasattr(self.sampler, "set_epoch"):
              self.sampler.set_epoch(self.epoch_counter)
          batch = next(self.dataset_iterator)
      return batch
  
imports: import os
  import torch
  import transformers
  from torch.utils.data import DataLoader
  from datasets.distributed import split_dataset_by_node
label_desc: Use image node_id 3 for calling the InfiniteDataLoader obj's underlying member method code with example usage: obj.__next__() and returns: batch