def iter_levels(skiplist, level):
        'Iterate through nodes on a given level.'
        node = skiplist.head
        while node is not NIL:
            yield node
            node = node.next[level]
Iterate through nodes on a given level.
recipes/Python/576930_Efficient_Running_Mediusing_Indexable/recipe-576930.py