This could simplify with 
```
            return [tuple(classes.take(np.flatnonzero(y_i))) for y_i in y]
```