(s, predicate)
return yes, no
Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
Split sequence s via predicate, and return pair ([true], [false]).
Split sequence s via predicate and return pair ( [ true ] [ false ] ) .
def _split_list(s, predicate):
    """Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    """

    yes = []
    no = []
    for x in s:
        if predicate(x):
            yes.append(x)
        else:
            no.append(x)
    return yes, no
def _split_list ( s , predicate ) : yes = [ ] no = [ ] for x in s : if predicate ( x ) : yes . append ( x ) else : no . append ( x ) return yes , no