code: def test_iter_class_balanced_dataset(self):
      single_dataset = MOTChallengeDataset(
          data_prefix=dict(img_path="imgs"),
          ann_file="tests/data/mot_sample.json",
          metainfo=dict(classes=("pedestrian", "person_on_vehicle")),
          filter_cfg=dict(filter_empty_gt=True, min_size=32),
          visibility_thr=0.1,
          test_mode=False,
          pipeline=[],
      )
  
      dataset = ClassBalancedDataset(single_dataset, oversample_thr=0.6)
      video_sampler = TrackImgSampler(dataset)
      assert len(video_sampler) == 8
      iterator = iter(video_sampler)
      assert isinstance(iterator, Iterable)
      for index in iterator:
          assert isinstance(index, tuple)
          video_index, frame_index = index
          assert video_index < 3
          if video_index == 0 or video_index == 2:
              assert frame_index >= 0 and frame_index < 3
          else:
              assert frame_index >= 0 and frame_index < 2
  
file_path: mmdetection/tests/test_datasets/test_samplers/test_track_img_sampler.py
imports: from collections.abc import Iterable
  from copy import deepcopy
  from unittest import TestCase
  from mmengine.dataset import ClassBalancedDataset, ConcatDataset
  from mmdet.datasets import MOTChallengeDataset, TrackImgSampler
label_desc: Use image node_id 3 for calling the TestTrackImgSampler obj's underlying member method code with example usage: obj.test_iter_class_balanced_dataset() without return types