def sequence(i=0, f=lambda i: i+1):
    # Used to generate unique vector id's in hierarchical().
    # We cannot use Vector.id, since the given vectors might be plain dicts.
    # We cannot use id(vector), since id() is only unique for the lifespan of the object.
    while True: 
        yield i; i=f(i)
Yields an infinite sequence, for example:
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/sequence