def splitSeq(seq, predicates):
    """
    Split a sequence into one seq for which predicates is True, and another
    for which predicates is False.

    Parameters
    ----------
    seq : iterable
      An arbitrary sequence.
    predicates : iterable( bool )
      Same length as seq. Each entry is the truth value of some predicate
      evaluated on seq.

    Returns
    -------
    pred_true : iterable
      Elements in seq whose corresponding entries in predicates are True
    pred_false : iterable
      Elements in seq whose corresponding entries in predicates are False
    """

    seq_len = len(seq)
    pred_len = len(predicates)
    if seq_len != pred_len:
        err_str = '{} sequence elements but {} predicates!'
        raise ValueError(err_str.format(seq_len, pred_len))

    pred_true = tuple(elem for elem, pred in zip(seq, predicates) if pred)
    pred_false = tuple(elem for elem, pred in zip(seq, predicates) if not pred)

    return pred_true, pred_false