def test_cvm(size=1000):
    y_pred = random.uniform(size=size)
    y = 0.5 > random.uniform(size=size)
    sample_weight = random.exponential(size=size)
    bin_indices = random.randint(0, 10, size=size)
    mask = y == 1
    groups_indices = bin_to_group_indices(bin_indices=bin_indices, mask=mask)
    cvm1 = bin_based_cvm(y_pred[mask], sample_weight=sample_weight[mask], bin_indices=bin_indices[mask])
    cvm2 = group_based_cvm(y_pred, mask=mask, sample_weight=sample_weight, groups_indices=groups_indices)
    assert numpy.allclose(cvm1, cvm2)
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/tests/test_metrics.py/test_cvm/swapped operands of `>`