def make_xy(self, on, off):
        x = []
        y = []
        for o in on:
            try:
                x.append(self.extractor(*o).reshape(1, -1))
                y.append(1)
            except ValueError:
                pass
        for o in off:
            try:
                x.append(self.extractor(*o).reshape(1, -1))
                y.append(0)
            except __HOLE__:
                pass
        x = np.vstack(x)
        y = np.hstack(y)

        #sklearn doesn't like non-finite values, which
        #occasionally popup
        if not np.isfinite(x).all():
            warnings.warn("Non-finite values in feature vectors. Fixing")
            x = np.nan_to_num(x)

        assert x.shape[0] == y.shape[0]
        assert x.ndim == 2
        assert y.ndim == 1

        return x, y
dataset/ETHPy150Open ChrisBeaumont/brut/bubbly/model.py/Model.make_xy