def partition(predicate, iterable):
    """Use a predicate to partition true and false entries.

    Reference
    ---------
    Python itertools documentation.
    """

    t1, t2 = tee(iterable)

    return filterfalse(predicate, t1), filter(predicate, t2)