def split(iterator, criterion):
    """Returns a list of objects that match criterion and those that do not.
    """
    a = []
    b = []
    for x in iterator:
        if criterion(x):
            a.append(x)
        else:
            b.append(x)
    return a, b
