code: def test_constant_iteration_strategy(self):
      dataloaders = self._build_dataloaders()
      strategy = (
          iteration_strategies.ConstantIterationStrategy.from_params(
              dataloaders=dataloaders
          )
      )
  
      counter = Counter()
      count = 100
      for _ in range(count):
          counter[strategy()] += 1
  
      self.assertEqual(counter[0], count)
      for idx in range(1, self.NUM_DATALOADERS):
          self.assertEqual(counter[idx], 0)
  
      strategy = (
          iteration_strategies.ConstantIterationStrategy.from_params(
              dataloaders=dataloaders, idx=1
          )
      )
  
      counter = Counter()
      count = 100
      for _ in range(count):
          counter[strategy()] += 1
  
      self.assertEqual(counter[1], count)
      for idx in range(0, self.NUM_DATALOADERS):
          if idx != 1:
              self.assertEqual(counter[idx], 0)
  
file_path: mmf/tests/datasets/test_iteration_strategies.py
imports: import unittest
  from collections import Counter
  import numpy
  import torch
  from mmf.datasets import iteration_strategies
  from tests.test_utils import NumbersDataset
label_desc: Use image node_id 3 for calling the TestIterationStrategies obj's underlying member method code with example usage: obj.test_constant_iteration_strategy() without return types