def _percentile(self, values, percent, key=lambda x: x):
vals = sorted(values)<EOL>k = (len(vals) - <NUM_LIT:1>) * (percent / <NUM_LIT:100>)<EOL>f = math.floor(k)<EOL>c = math.ceil(k)<EOL>if f == c:<EOL><INDENT>return key(vals[int(k)])<EOL><DEDENT>d0 = key(vals[int(f)]) * (c - k)<EOL>d1 = key(vals[int(c)]) * (k - f)<EOL>return d0 + d1<EOL>
Find the percentile of a list of values.

        Args:
            values: A list of values for which percentiles are desired
            percent: A float value from 0 to 100 representing the requested percentile.
            key: optional key function to compute value from each element of N.

        Return:
            The percentile of the values