def split(lst, sel):
    """Split a list using a selector function."""
    group = {}
    groups = [group]
    for el in lst:
        if sel(el):
            group = {}
            groups.append(group)
        group[el[0]] = el[1]
    return groups