Ejemplo n.º 1
0
 def test_imerge2(self):
     a = list(range(10))
     b = list(range(1, 6))
     c = list(range(3, 14))
     a.reverse()
     b.reverse()
     c.reverse()
     self.assertEqual(list(iter.imerge(lambda a,b: a >= b, a, b, c)),
                      [13, 12,11, 10,
                       9, 9, 8, 8, 7, 7, 6, 6,
                       5, 5, 5, 4, 4, 4, 3, 3, 3,
                       2, 2, 1, 1,
                       0])
Ejemplo n.º 2
0
 def test_imerge2(self):
     a = range(10)
     b = range(1, 6)
     c = range(3, 14)
     a.reverse()
     b.reverse()
     c.reverse()
     self.assertEqual(list(iter.imerge(lambda a,b: a >= b, a, b, c)),
                      [13, 12,11, 10,
                       9, 9, 8, 8, 7, 7, 6, 6,
                       5, 5, 5, 4, 4, 4, 3, 3, 3,
                       2, 2, 1, 1,
                       0])
Ejemplo n.º 3
0
def all_dbf_points_of_change_dk(all_tsks, max_t, dk):
    all_points = [dbf_points_of_change_dk(t, max_t, dk) for t in all_tsks]
    return uniq(imerge(lambda x,y: x < y, *all_points))
Ejemplo n.º 4
0
 def test_uniq(self):
     s = iter.uniq(iter.imerge(lambda x, y: x < y, self.s1, self.s2, self.s3))
     self.assertEqual(list(s)[:10],
         [-3, 1, 4, 7, 9, 10, 13, 14, 16, 19])
Ejemplo n.º 5
0
 def test_uniq(self):
     s = iter.uniq(iter.imerge(lambda x, y: x < y, self.s1, self.s2, self.s3))
     self.assertEqual(list(s)[:10],
         [-3, 1, 4, 7, 9, 10, 13, 14, 16, 19])
Ejemplo n.º 6
0
def testing_set(ts, speed, min_time):
    all_points = [test_points(ti, speed, min_time) for ti in ts]
    return uniq(imerge(lambda x,y: x < y, *all_points))
Ejemplo n.º 7
0
def testing_set(ts, speed, min_time):
    all_points = [test_points(ti, speed, min_time) for ti in ts]
    return uniq(imerge(lambda x, y: x < y, *all_points))
Ejemplo n.º 8
0
def all_dbf_points_of_change_dk(all_tsks, max_t, dk):
    all_points = [dbf_points_of_change_dk(t, max_t, dk) for t in all_tsks]
    return uniq(imerge(lambda x, y: x < y, *all_points))