This modules provides iterator tools.
CodeReview.Tools.IteratorTools.
iter_with_last_flag
Iterate over an iterable and yield a 2-tuple containing the current item and a Boolean indicating if it is the last item.
pairwise
Return a generator which generate a pair wise list from an iterable: s -> (s[0],s[1]), (s[1],s[2]), … (s[N-1], s[N]).