'Iterate through all combinations of attributes as ordered by Relief,
starting with a single attribute if Mosaic is colored by class
distributions, and two if by Pearson.'

def iterate_states(self, state):

    master = self.master
    data = master.discrete_data
    if (state is None):
        if self._compute_class_dists():
            self.marginal = get_distribution(data, data.domain.class_var)
            self.marginal.normalize()
            state = [0]
        else:
            self.marginal = get_distributions(data)
            for dist in self.marginal:
                dist.normalize()
            state = [0, 1]
    n_attrs = len(data.domain.attributes)
    while True:
        (yield state)
        if (self.attr_ordering is None):
            break
        for (up, _) in enumerate(state):
            state[up] += 1
            if (((up + 1) == len(state)) or (state[up] < state[(up + 1)])):
                break
            state[up] = up
        if (state[(-1)] == len(self.attr_ordering)):
            if (len(state) < min(self.max_attrs, n_attrs)):
                state = list(range((len(state) + 1)))
            else:
                break
