'Returns a percentile value (e.g. fraction = 0.95 -> 95th percentile)'

def percentile(self, values, fraction):

    values = sorted(values)
    stopat = int((len(values) * fraction))
    if (stopat == len(values)):
        stopat -= 1
    return values[stopat]
