#NEWLINE# def get_percentile( self , provider , interaction , raw_value ) : #NEWLINE# #INDENT# percentile_list_dict = self . get_percentile_lookup_list ( provider , interaction ) #NEWLINE# if ( ( not percentile_list_dict ) or ( not percentile_list_dict [ 'percentile_list' ] ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# percentile = 0 #NEWLINE# for p in percentile_list_dict [ 'percentile_list' ] . percentiles : #NEWLINE# #INDENT# percentile += 1 #NEWLINE# if ( p >= raw_value ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# if ( percentile >= 100 ) : #NEWLINE# #INDENT# percentile = 99 #NEWLINE# #UNINDENT# lookup_mendeley_discipline = percentile_list_dict [ 'mendeley_discipline' ] #NEWLINE# if ( ( not lookup_mendeley_discipline ) or ( lookup_mendeley_discipline == 'ALL' ) ) : #NEWLINE# #INDENT# lookup_mendeley_discipline = '' #NEWLINE# #UNINDENT# response = { #NEWLINE# #INDENT# 'value' : percentile , #NEWLINE# 'mendeley_discipline_str' : self , #NEWLINE# 'genre_plural' : get_genre_config ( self . genre ) [ 'plural_name' ] , #NEWLINE# #UNINDENT# } #NEWLINE# return response