def get_percentile(N, percent, key=lambda x:x):
    if not N:
        return 0
    k = (len(N) - 1) * percent
    f = math.floor(k)
    c = math.ceil(k)
    if f == c:
        return key(N[int(k)])
    d0 = key(N[int(f)]) * (k-c)
    d1 = key(N[int(c)]) * (k-f)
    return d0 + d1
dataset/ETHPy150Open radlab/sparrow/simulation/simulation_centralized.py/get_percentile/swapped operands of `-`