bits_generator = (set(x) for x in itertools.combinations(list(range(n)), k))
first_set = set([0, 1, 2])
filter_bits = (x for x in bits_generator if x.issubset(first_set) or x.
    isdisjoint(first_set))
answer_for_first_set = list(filter_bits)
Prune a list of combinations based on sets