Assert equality of two nodes a and b so find(a) is find(b).

def union(a, b):
    """Assert equality of two nodes a and b so find(a) is find(b)."""
    a = find(a)
    b = find(b)
    if a is not b:
        if a.rank < b.rank:
            a.parent = b
        elif b.rank < a.rank:
            b.parent = a
        else:
            b.parent = a
            a.rank += 1