def parse_filter(vals):
    type_val_pairs = map(split_type_and_val, vals)

    # create filters
    filters = []
    for type, val in type_val_pairs:
        clsname = DefQuery.query_filter(val)
        if clsname is None:
            errmsg = "%s" % (vals)
            raise exception.UndefinedFilterException(errmsg)

        val = get_ground_truth_val(clsname, val)
        filter = create_filter(clsname, val, type)
        filters.append(filter)

    get_key = lambda filter: filter.get_tag_name()
    grouped = groupby(sorted(filters, key=get_key), get_key)
    # merge filters in the same group
    filters = [reduce(add, group) for _, group in grouped]
    return filters
Parse `[val1, val2, ...]` format string list and return relative filters
dataset/ETHPy150Open loggerhead/Easy-Karabiner/easy_karabiner/filter.py/parse_filter