class_docstr: We take a dictionary of BatchIterators and do round robin over them in a cycle.
  The below describes the behavior for one epoch, with the example
  
  Iterator 1: [A, B, C, D],  Iterator 2: [a, b]
  
  If `upsample` is True:
      If `iter_to_set_epoch` is set, cycle batches from each iterator until one epoch
      of the target iterator is fulfilled. Iterators with fewer batches than the
      target iterator are repeated, so they never run out.
  
      iter_to_set_epoch = "Iterator 1"
      Output: [A, a, B, b, C, a, D, b]
  
      If `iter_to_set_epoch` is None, cycle over batches from each iterator until the
      shortest iterator completes one epoch.
  
      Output: [A, a, B, b]
  
  If `upsample` is False:
      Iterate over batches from one epoch of each iterator, with the order among
      iterators uniformly shuffled.
  
      Possible output: [a, A, B, C, b, D]
  
  Args:
      iterators (Dict[str, BatchIterator]): Iterators to do roundrobin over.
      upsample (bool): If upsample, keep cycling over each iterator in round-robin.
        Iterators with less batches will get more passes.  If False, we do single
        pass over each iterator, in random order. Evaluation will use upsample=False.
        Default True.
      iter_to_set_epoch (Optional[str]): Name of iterator to define epoch size.
        If upsample is True and this is not set, epoch size defaults to the length of
        the shortest iterator. If upsample is False, this argument is not used.
  Attributes:
      iterators (Dict[str, BatchIterator]): Iterators to do roundrobin over.
      upsample (bool): Whether to upsample iterators with fewer batches.
      iter_to_set_epoch (str): Name of iterator to define epoch size.
class_docstr_tok: ["We","take","a","dictionary","of","BatchIterators","and","do","round","robin","over","them","in","a","cycle",".","The","below","describes","the","behavior","for","one","epoch",",","with","the","example","Iterator","1",":","[","A",",","B",",","C",",","D","]",",","Iterator","2",":","[","a",",","b","]","If","`","upsample","`","is","True",":","If","`","iter_to_set_epoch","`","is","set",",","cycle","batches","from","each","iterator","until","one","epoch","of","the","target","iterator","is","fulfilled",".","Iterators","with","fewer","batches","than","the","target","iterator","are","repeated",",","so","they","never","run","out",".","iter_to_set_epoch","=","``","Iterator","1","''","Output",":","[","A",",","a",",","B",",","b",",","C",",","a",",","D",",","b","]","If","`","iter_to_set_epoch","`","is","None",",","cycle","over","batches","from","each","iterator","until","the","shortest","iterator","completes","one","epoch",".","Output",":","[","A",",","a",",","B",",","b","]","If","`","upsample","`","is","False",":","Iterate","over","batches","from","one","epoch","of","each","iterator",",","with","the","order","among","iterators","uniformly","shuffled",".","Possible","output",":","[","a",",","A",",","B",",","C",",","b",",","D","]","Args",":","iterators","(","Dict","[","str",",","BatchIterator","]",")",":","Iterators","to","do","roundrobin","over",".","upsample","(","bool",")",":","If","upsample",",","keep","cycling","over","each","iterator","in","round-robin",".","Iterators","with","less","batches","will","get","more","passes",".","If","False",",","we","do","single","pass","over","each","iterator",",","in","random","order",".","Evaluation","will","use","upsample=False",".","Default","True",".","iter_to_set_epoch","(","Optional","[","str","]",")",":","Name","of","iterator","to","define","epoch","size",".","If","upsample","is","True","and","this","is","not","set",",","epoch","size","defaults","to","the","length","of","the","shortest","iterator",".","If","upsample","is","False",",","this","argument","is","not","used",".","Attributes",":","iterators","(","Dict","[","str",",","BatchIterator","]",")",":","Iterators","to","do","roundrobin","over",".","upsample","(","bool",")",":","Whether","to","upsample","iterators","with","fewer","batches",".","iter_to_set_epoch","(","str",")",":","Name","of","iterator","to","define","epoch","size","."]
code: def __init__(
      self,
      iterators: Dict[str, BatchIterator],
      upsample: bool = True,
      iter_to_set_epoch: Optional[str] = None,
  ) -> None:
      self.iterators = iterators
      self.upsample = upsample
      self.iter_to_set_epoch = iter_to_set_epoch
  
imports: import itertools
  from collections import OrderedDict
  from typing import Dict, Optional, Tuple
  import numpy
  from pytext.common.constants import BatchContext
  from .data_handler import BatchIterator, DataHandler
label_desc: Use image node_id 1 to create a new RoundRobinBatchIterator object from inherited base classes: BatchIterator with example: obj = RoundRobinBatchIterator(iterators, upsample, iter_to_set_epoch)