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_datasets(self, worker_id):
      if self.num_workers > 0:
          stride = self.stride * self.num_workers
          offset = self.offset * self.num_workers + worker_id
      else:
          stride = self.stride
          offset = self.offset
      datasets_iterables = build_corpora_iters(
          self.corpora,
          self.transforms,
          self.corpora_info,
          skip_empty_level=self.skip_empty_level,
          stride=stride,
          offset=offset,
      )
      datasets_weights = {
          ds_name: int(self.corpora_info[ds_name]["weight"])
          for ds_name in datasets_iterables.keys()
      }
      if self.task == CorpusTask.TRAIN:
          self.mixer = WeightedMixer(
              datasets_iterables, datasets_weights
          )
      else:
          self.mixer = SequentialMixer(
              datasets_iterables, datasets_weights
          )
      self.init_iterators = True
  
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 3 for calling the DynamicDatasetIter obj's underlying member method code with example usage: obj._init_datasets(worker_id) without return types