class_docstr: Yield batch from (multiple) plain text corpus.
  
  Args:
      corpora (dict[str, ParallelCorpus]): collections of corpora to iterate;
      corpora_info (dict[str, dict]): corpora infos correspond to corpora;
      transforms (dict[str, Transform]): transforms may be used by corpora;
      vocabs (dict[str, Vocab]): vocab dict for convert corpora into Tensor;
      task (str): CorpusTask.TRAIN/VALID/INFER;
      batch_type (str): batching type to count on, choices=[tokens, sents];
      batch_size (int): numbers of examples in a batch;
      batch_size_multiple (int): make batch size multiply of this;
      data_type (str): input data type, currently only text;
      bucket_size (int): accum this number of examples in a dynamic dataset;
      bucket_size_init (int): initialize the bucket with this
      amount of examples;
      bucket_size_increment (int): increment the bucket
      size with this amount of examples;
      copy (Bool): if True, will add specific items for copy_attn
      skip_empty_level (str): security level when encouter empty line;
      stride (int): iterate data files with this stride;
      offset (int): iterate data files with this offset.
  
  Attributes:
      sort_key (function): functions define how to sort examples;
      mixer (MixingStrategy): the strategy to iterate corpora.
code: def __init__(
      self,
      corpora,
      corpora_info,
      transforms,
      vocabs,
      task,
      batch_type,
      batch_size,
      batch_size_multiple,
      data_type="text",
      bucket_size=2048,
      bucket_size_init=-1,
      bucket_size_increment=0,
      copy=False,
      device=torch.device("cpu"),
      skip_empty_level="warning",
      stride=1,
      offset=0,
  ):
      super(DynamicDatasetIter).__init__()
      self.corpora = corpora
      self.transforms = transforms
      self.vocabs = vocabs
      self.corpora_info = corpora_info
      self.task = task
      self.init_iterators = False
      self.batch_size = batch_size
      self.batch_type = batch_type
      self.batch_size_multiple = batch_size_multiple
      self.sort_key = text_sort_key
      self.bucket_size = bucket_size
      self.bucket_size_init = bucket_size_init
      self.bucket_size_increment = bucket_size_increment
      self.copy = copy
      self.device = device
      if stride <= 0:
          raise ValueError(f"Invalid argument for stride={stride}.")
      self.stride = stride
      self.offset = offset
      if skip_empty_level not in ["silent", "warning", "error"]:
          raise ValueError(
              f"Invalid argument skip_empty_level={skip_empty_level}"
          )
      self.skip_empty_level = skip_empty_level
      self.random_shuffler = RandomShuffler()
      self.bucket_idx = 0
      if (
          task != CorpusTask.TRAIN
          and vocabs["data_task"] == ModelTask.LANGUAGE_MODEL
      ):
          self.left_pad = True
      else:
          self.left_pad = False
  
imports: import torch
  from itertools import cycle
  from onmt.constants import CorpusTask, ModelTask
  from onmt.inputters.text_corpus import get_corpora, build_corpora_iters
  from onmt.inputters.text_utils import text_sort_key, process, numericalize, tensorify, _addcopykeys
  from onmt.transforms import make_transforms
  from onmt.utils.logging import init_logger, logger
  from onmt.utils.misc import RandomShuffler
  from torch.utils.data import DataLoader
label_desc: Use image node_id 1 to create a new DynamicDatasetIter object from inherited base classes: torch.utils.data with example: obj = DynamicDatasetIter(corpora, corpora_info, transforms, vocabs, task, batch_type, batch_size, batch_size_multiple, data_type, bucket_size, bucket_size_init, bucket_size_increment, copy, device, skip_empty_level, stride, offset)