def fit(self, X, y, sample_weight=None):
        sample_weight = check_sample_weight(y, sample_weight=sample_weight)
        assert len(X) == len(y), 'lengths are different'
        X = pandas.DataFrame(X)

        self.group_indices = dict()
        self.group_weights = dict()

        occurences = numpy.zeros(len(X))
        for label in self.uniform_label:
            self.group_indices[label] = self.compute_groups_indices(X, y, label=label)
            self.group_weights[label] = compute_group_weights(self.group_indices[label], sample_weight=sample_weight)
            for group in self.group_indices[label]:
                occurences[group] += 1

        out_of_bins = (occurences == 0) & numpy.in1d(y, self.uniform_label)
        if numpy.mean(out_of_bins) > 0.01:
            warnings.warn(numpy.sum(out_of_bins) % "%i events out of all bins ", UserWarning)

        self.y = y
        self.y_signed = 2 * y - 1
        self.sample_weight = numpy.copy(sample_weight)
        self.divided_weight = sample_weight / numpy.maximum(occurences, 1)

        if self.keep_debug_info:
            self.debug_dict = defaultdict(list)
        return self
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/losses.py/AbstractFlatnessLossFunction.fit/swapped operands of `%`