def test_parallel_with_gradual_reweighting_remainders(self):
    """Test of the parallel ccmbinator with weights and minimum."""
    dataset1 = lambda: (i for i in itertools.cycle(range(1)))
    dataset2 = lambda: (i for i in itertools.cycle(range(10, 30)))
    dataset3 = lambda: (i for i in itertools.cycle(range(30, 80)))
    parallel = data.Parallel([dataset2, dataset1, dataset3],
                             counters=(20, 1, 50),
                             gradually_reweight=True,
                             use_remainders=True)
    generator = parallel()

    for _ in range(3):
      self.assertEqual(next(generator), 0)
      for i in range(20):
        self.assertEqual(next(generator), 10 + i)
        self.assertEqual(next(generator), 30 + 2 * i)
        self.assertEqual(next(generator), 30 + 2 * i + 1)
      # Here we process the remainder from dataset 3:
      for i in range(10):
        self.assertEqual(next(generator), 70 + i)
Test of the parallel ccmbinator with weights and minimum.
trax/data/inputs_test.py