def compute_positions(y_pred, sample_weight):
    """For each event computes it position among other events by prediction.
    position = part of elements with lower predictions => position belongs to [0, 1]"""
    order = numpy.argsort(y_pred)
    ordered_weights = sample_weight[order]
    ordered_weights /= float(numpy.sum(ordered_weights))
    efficiencies = (0.5 * ordered_weights - numpy.cumsum(ordered_weights))
    return efficiencies[numpy.argsort(order)]
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/losses.py/compute_positions/swapped operands of `-`