code: def test_proportional_sampling(self):
      self.multi_dataset._infer_dataset_probabilities()
  
      count = 0
      count_c = 0
      for batch in self.multi_dataset:
          batch = self.multi_dataset.prepare_batch(batch)
          if "c" in batch:
              count_c += 1
          count += 1
          if count == 100:
              break
  
      # Expect more than 95 c's at least as the len for c is very high
      self.assertTrue(count_c >= 98)
  
      count = 0
      count_epoch = 0
      counter = Counter()
      for _ in range(1):
          for batch in self.multi_dataset:
              batch = self.multi_dataset.prepare_batch(batch)
              counter[list(batch.keys())[0]] += 1
              count += 1
          count_epoch += 1
      # Expect epoch to be completed
      self.assertEqual(count_epoch, 1)
      # Expect each dataset to be full iterated
      self.assertEqual(count, self.multi_dataset._total_length // 4)
      self.assertEqual(counter, Counter({"a": 1, "b": 10, "c": 1000}))
  
file_path: mmf/tests/datasets/test_multi_dataset_loader.py
imports: import unittest
  from collections import Counter
  import numpy
  import torch
  from mmf.common.registry import registry
  from mmf.datasets.multi_dataset_loader import MultiDatasetLoader
  from omegaconf import OmegaConf
  from torch.utils.data import DataLoader
  from ..test_utils import NumbersDataset
label_desc: Use image node_id 4 for calling the TestMultiDatasetLoader obj's underlying member method code with example usage: obj.test_proportional_sampling() without return types