class_docstr: A simple wrapper for iterating over multiple iterators.
  
  Args:
      loaders (List[Loader]): List of Iterator loaders.
      ratios (List[float]): List of ratios to sample from each loader. If None, all loaders are sampled uniformly.
class_docstr_tok: ["A","simple","wrapper","for","iterating","over","multiple","iterators",".","Args",":","loaders","(","List","[","Loader","]",")",":","List","of","Iterator","loaders",".","ratios","(","List","[","float","]",")",":","List","of","ratios","to","sample","from","each","loader",".","If","None",",","all","loaders","are","sampled","uniformly","."]
code: def __init__(self, loaders, ratios=None):
      # assert all loaders has __next__ method
      for loader in loaders:
          assert hasattr(
              loader, "__next__"
          ), "Loader {} has no __next__ method.".format(loader)
      if ratios is None:
          ratios = [1.0] * len(loaders)
      else:
          assert len(ratios) == len(loaders)
          ratios = [float(ratio) / sum(ratios) for ratio in ratios]
  
      self.loaders = loaders
      self.ratios = ratios
  
imports: import time
  import random
  import torch
  from lavis.datasets.data_utils import move_to_cuda
  from torch.utils.data import DataLoader
label_desc: Use image node_id 1 to create a new MultiIterLoader object  with example: obj = MultiIterLoader(loaders, ratios)