def groups_based_ks(y_pred, mask, sample_weight, groups_indices):
    assert len(y_pred) == len(sample_weight) == len(mask)
    group_weights = compute_group_weights(groups_indices, sample_weight=sample_weight)
    prepared_data, prepared_weight, prep_F = prepare_distibution(y_pred[mask], weights=sample_weight[mask])

    result = 0.
    for group_weight, group_indices in zip(group_weights, groups_indices):
        local_distribution = y_pred[group_indices]
        local_weights = sample_weight[group_indices]
        result += group_weight * \
                  _ks_2samp_fast(prepared_data, local_distribution, prepared_weight, local_weights, prep_F)
    return result
delete a F5 load balancer device
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/metrics_utils.py/groups_based_ks--crossover with--dataset/ETHPy150Open jasonhancock/cloudstack-python-client/CloudStack/Client.py/Client.deleteF5LoadBalancer