class_docstr: InOrderIterator returns all batches from a single dataset
  till it is exhausted and then moves to the next one.
  
  By default, the order is same as the keys of the input
  dataloader dict. This can be overridden to provide custom order.
  Repetition is supported.
  
  Returns batches of the format: {dataloader_name: batch_from_dataloader}
  
  Args:
      individual_dataloaders (Mapping[str, Union[DataLoader, Iterable]]): A mapping of DataLoaders or Iterables with dataloader name as key
      and dataloader/iterable object as value.
      iteration_strategy (RandomizedBatchSampler): A RandomizedBatchSampler dataclass indicating how the dataloaders are iterated over.
  
  Examples:
      >>> loaders = {'a': torch.utils.data.DataLoader(range(4), batch_size=4),
          'b': torch.utils.data.DataLoader(range(15), batch_size=5)}
      >>> in_order_strategy = InOrder()
      >>> combined_iterator = RandomizedBatchSamplerIterator(loaders, in_order_strategy)
      >>> for item in combined_iterator:
              print(item)
      {'a': tensor([0, 1, 2, 3])}
      {'b': tensor([0, 1, 2, 3, 4])}
      {'b': tensor([5, 6, 7, 8, 9])}
      {'b': tensor([10, 11, 12, 13, 14])}
code: def __next__(self) -> Dict[str, Any]:
      if self.iterators_finished == self.num_iterators:
          raise StopIteration
  
      try:
          return {self.cur_iterator: next(self.cur_iter)}
      except StopIteration:
          self.iterators_finished += 1
  
          # Raise exception when all iterators are finished
          if self.iterators_finished == self.num_iterators:
              raise StopIteration
  
          self.cur_iterator = self.iteration_order[
              self.iterators_finished
          ]
  
          self.cur_iter = iter(
              self.individual_dataloaders[self.cur_iterator]
          )
  
          return self.__next__()
  
imports: from __future__ import annotations
  import random
  from abc import abstractmethod
  from dataclasses import dataclass
  from enum import Enum
  from itertools import cycle
  from typing import Any, Dict, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Type, TYPE_CHECKING, Union
  import torch
  import torch.distributed
label_desc: Use image node_id 2 for calling the InOrderIterator obj's underlying member method code with example usage: obj.__next__() and returns: dict, self