def split_list(ls, sep):
    """
    Split list similarly to split string, according to some separator
    """
    ret = []
    cur = []
    for x in ls:
        if (x != sep):
            cur.append(x)
        elif cur:
            ret.append(cur)
            cur = []
    if cur:
        ret.append(cur)
    return ret