def partition(condition, collection) -> Tuple[List, List]:
succeed, fail = [], []<EOL>for x in collection:<EOL><INDENT>if condition(x):<EOL><INDENT>succeed.append(x)<EOL><DEDENT>else:<EOL><INDENT>fail.append(x)<EOL><DEDENT><DEDENT>return succeed, fail<EOL>
Partitions a list into two based on a condition.