def bins(self):
        """Event and non-events counts for each bin given the current
        categories.

        Returns
        -------
        bins : tuple of arrays.
        """
        cat_others = []

        dd = {k: v + [v[0] + v[1], v[1] / (v[0] + v[1])]
              for k, v in self._d_categories.items()}

        if self.cat_cutoff is not None:
            bin_e_others = 0
            bin_ne_others = 0
            for k, v in dd.items():
                if v[2] / self.n < self.cat_cutoff:
                    bin_ne_others += v[0]
                    bin_e_others += v[1]
                    cat_others.append(k)

            cat_others = np.array(cat_others, dtype=object)

            dd = {k: v for k, v in sorted(dd.items(), key=lambda v: v[1][3])
                  if k not in cat_others}
        else:
            bin_e_others = []
            bin_ne_others = []
            dd = {k: v for k, v in sorted(dd.items(), key=lambda v: v[1][3])}

        categories = np.array(list(dd.keys()), dtype=object)
        bin_ne = np.array([v[0] for v in dd.values()], dtype=np.int64)
        bin_e = np.array([v[1] for v in dd.values()], dtype=np.int64)

        splits = np.array([0.5 + i for i in range(len(categories) - 1)])

        return (splits, categories, bin_ne, bin_e, cat_others, bin_ne_others,
                bin_e_others)
Event and non-events counts for each bin given the current
        categories.

        Returns
        -------
        bins : tuple of arrays.
        
optbinning/binning/distributed/bsketch.py