code: def test_prob_batch_sampler(self):
      sampler = RandomizedBatchSampler(
          unnormalized_iterator_probs={"A": 1, "B": 0}
      )
  
      prob_iterator = self._truncate(
          iter(sampler.batchify(self.iter_dict)), 8
      )
      expected_items = ["1", "2", "3", "4", "5", "1", "2", "3"]
      self._check_iterator(prob_iterator, expected_items)
      prob_iterator = self._truncate(
          iter(sampler.batchify(self.iter_dict)), 8
      )
      expected_items = ["4", "5", "1", "2", "3", "4", "5", "1"]
      self._check_iterator(prob_iterator, expected_items)
  
      sampler = RandomizedBatchSampler(
          unnormalized_iterator_probs={"A": 0, "B": 1}
      )
      prob_iterator = self._truncate(
          sampler.batchify(self.iter_dict), 5
      )
      expected_items = ["a", "b", "c", "a", "b"]
      self._check_iterator(prob_iterator, expected_items)
      prob_iterator = self._truncate(
          sampler.batchify(self.iter_dict), 5
      )
      expected_items = ["c", "a", "b", "c", "a"]
      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 4 for calling the BatchSamplerTest obj's underlying member method code with example usage: obj.test_prob_batch_sampler() without return types