def bifurcate(pred, seq):
    if pred is None:
        pred = lambda x: x
res1 = []
res2 = []
for i in seq:
    if pred(i):
        res1.append(i)
else:
    res2.append(i)
return res2, res1
elegantly splitting a list (or dict) into two via some arbitrary function in python