def test_rotate(self): n1 = [0, 1, 3, 7] self.assertEqual(music.rotate(n1, 0), n1) self.assertEqual(music.rotate(n1, 1), [1, 3, 7, 0]) self.assertEqual(music.rotate(n1, 2), [3, 7, 0, 1]) self.assertEqual(music.rotate(n1, 3), [7, 0, 1, 3]) self.assertEqual(music.rotate(n1, 4), [0, 1, 3, 7])
def set_sizes(pset): return [interval(x, y) for x, y in zip(rotate(pset, len(pset) - 1), pset)]
def set_sizes(pset): return [interval(x, y) for x,y in zip(rotate(pset, len(pset) - 1), pset)]