code: def test_alternate_prob_batch_sampler(self):
      sampler = AlternatingRandomizedBatchSampler(
          unnormalized_iterator_probs={"A": 1, "B": 0},
          second_unnormalized_iterator_probs={"C": 0, "D": 1},
      )
  
      prob_iterator = self._truncate(
          iter(sampler.batchify(self.alternating_iter_dict)), 12
      )
      expected_items = [
          "1",
          "6",
          "2",
          "7",
          "3",
          "8",
          "4",
          "9",
          "5",
          "10",
          "1",
          "6",
      ]
      self._check_iterator(prob_iterator, expected_items)
      prob_iterator = self._truncate(
          iter(sampler.batchify(self.alternating_iter_dict)), 4
      )
      expected_items = ["2", "7", "3", "8"]
      self._check_iterator(prob_iterator, expected_items)
  
      sampler = AlternatingRandomizedBatchSampler(
          unnormalized_iterator_probs={"A": 0, "B": 1},
          second_unnormalized_iterator_probs={"C": 1, "D": 0},
      )
      prob_iterator = self._truncate(
          sampler.batchify(self.alternating_iter_dict), 9
      )
      expected_items = ["a", "d", "b", "e", "c", "f", "a", "d", "b"]
      self._check_iterator(prob_iterator, expected_items)
      prob_iterator = self._truncate(
          sampler.batchify(self.alternating_iter_dict), 3
      )
      expected_items = ["e", "c", "f"]
      self._check_iterator(prob_iterator, expected_items)
  
file_path: pytext/pytext/data/test/batch_sampler_test.py
imports: import unittest
  from pytext.data import AlternatingRandomizedBatchSampler, EvalBatchSampler, RandomizedBatchSampler, RoundRobinBatchSampler
label_desc: Use image node_id 5 for calling the BatchSamplerTest obj's underlying member method code with example usage: obj.test_alternate_prob_batch_sampler() without return types