def cyclen(n, iterable):
 return chain.from_iterable(repeat(tuple(iterable), n))

def cyclen ( n , iterable ) : return chain . from_iterable ( repeat ( tuple ( iterable ) , n ) )
cyclen -> iterator repeats the elements of iterable n times .