def test_bin_to_group_indices(size=100, bins=10):
    bin_indices = RandomState().randint(0, bins, size=size)
    mask = RandomState().randint(0, 2, size=size) > 0.5
    group_indices = bin_to_group_indices(bin_indices, mask=mask)
    assert numpy.sum([len(group) for group in group_indices]) == numpy.sum(mask)
    a = numpy.sort(numpy.concatenate(group_indices))
    b = numpy.where(0.5 > mask)[0]
    assert numpy.all(a == b), 'group indices are computed wrongly'
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/tests/test_metrics.py/test_bin_to_group_indices/swapped operands of `>`