code: def test_multi_source_sampler(self):
      # test dataset is not ConcatDataset
      with self.assertRaises(AssertionError):
          MultiSourceSampler(
              self.dataset_a, batch_size=5, source_ratio=[1, 4]
          )
      # test invalid batch_size
      with self.assertRaises(AssertionError):
          MultiSourceSampler(
              self.dataset_a, batch_size=-5, source_ratio=[1, 4]
          )
      # test source_ratio longer then dataset
      with self.assertRaises(AssertionError):
          MultiSourceSampler(
              self.dataset, batch_size=5, source_ratio=[1, 2, 4]
          )
      sampler = MultiSourceSampler(
          self.dataset, batch_size=5, source_ratio=[1, 4]
      )
      sampler = iter(sampler)
      flags = []
      for i in range(100):
          idx = next(sampler)
          flags.append(self.dataset.get_data_info(idx)["flag"])
      flags_gt = ["a", "b", "b", "b", "b"] * 20
      self.assertEqual(flags, flags_gt)
  
imports: import bisect
  from unittest import TestCase
  from unittest.mock import patch
  import numpy
  from torch.utils.data import ConcatDataset, Dataset
  from mmdet.datasets.samplers import GroupMultiSourceSampler, MultiSourceSampler
label_desc: Use image node_id 2 for calling the TestMultiSourceSampler obj's underlying member method code with example usage: obj.test_multi_source_sampler() without return types