def score_for_percentile_in(self, leaderboard_name, percentile):
if not <NUM_LIT:0> <= percentile <= <NUM_LIT:100>:<EOL><INDENT>return None<EOL><DEDENT>total_members = self.total_members_in(leaderboard_name)<EOL>if total_members < <NUM_LIT:1>:<EOL><INDENT>return None<EOL><DEDENT>if self.order == self.ASC:<EOL><INDENT>percentile = <NUM_LIT:100> - percentile<EOL><DEDENT>index = (total_members - <NUM_LIT:1>) * (percentile / <NUM_LIT>)<EOL>scores = [<EOL>pair[<NUM_LIT:1>] for pair in self.redis_connection.zrange(<EOL>leaderboard_name, int(<EOL>math.floor(index)), int(<EOL>math.ceil(index)), withscores=True)]<EOL>if index == math.floor(index):<EOL><INDENT>return scores[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>interpolate_fraction = index - math.floor(index)<EOL>return scores[<NUM_LIT:0>] + interpolate_fraction * (scores[<NUM_LIT:1>] - scores[<NUM_LIT:0>])<EOL><DEDENT>
Calculate the score for a given percentile value in the leaderboard.

@param leaderboard_name [String] Name of the leaderboard.
@param percentile [float] Percentile value (0.0 to 100.0 inclusive).
@return the score corresponding to the percentile argument. Return +None+ for arguments outside 0-100 inclusive and for leaderboards with no members.