def partition(pred, iterable):
    """
    Partion a list in two lists
    where the first list hold all items
    for which the function pred returned True
    and the second list holds all reset.

    @param pred a function that returns True or False and has one parameter
    @param iterable a list of items which can be called with pred

    @returns two list one with all items for which pred returned True
                and a second list with all items for which pred returned False
    """
    trues = []
    falses = []
    for item in iterable:
        if pred(item):
            trues.append(item)
        else:
            falses.append(item)
    return trues, falses