def facet_dedup(facets):
    """
    Remove duplicate ('foo', True) facets. Keep all the ones with other values.
    """
    if not facets:
        return []
    dups = set()
    ret = []
    for f in facets:
        a, b = f
        if b is True:
            if a not in dups:
                ret.append((a, b))
                dups.add(a)
        else:
            ret.append((a, b))
    return ret
