code: def test_random_sampling_dataloader_restart_until_all_datasets_exhausted(
      self,
  ) -> None:
      dataloader_1 = DataLoader(
          RandomDataset(size=32, length=8), batch_size=8
      )
      dataloader_2 = DataLoader(
          RandomDataset(size=32, length=256), batch_size=8
      )
  
      multi_dataloader = iter(
          MultiDataLoader(
              self._get_dataloaders_dict(dataloader_1, dataloader_2),
              RandomizedBatchSampler(
                  weights={"1": 100, "2": 1},
                  stopping_mechanism=StoppingMechanism.RESTART_UNTIL_ALL_DATASETS_EXHAUSTED,
              ),
          )
      )
  
      num_trials = 32
      selected_datasets = [
          next(multi_dataloader).popitem()[0] for _ in range(num_trials)
      ]
      # check that 1 is significantly more common, even if it is shorter
      counts = Counter(selected_datasets)
      self.assertTrue(counts["1"] > 0.8 * len(selected_datasets))
  
imports: import random
  import unittest
  from collections import Counter
  from typing import Any, cast, Dict, Iterable, Iterator, List, Mapping, Union
  import torch
  from torch.utils.data import DataLoader, Dataset
  from torchtnt.utils.data.iterators import AllDatasetBatches, DataIterationStrategy, InOrder, MultiIterator, RandomizedBatchSampler, RoundRobin, StoppingMechanism
  from torchtnt.utils.data.multi_dataloader import MultiDataLoader
label_desc: Use image node_id 11 for calling the TestMultiDataLoader obj's underlying member method code with example usage: obj.test_random_sampling_dataloader_restart_until_all_datasets_exhausted() without return types