#NEWLINE# def percentiles_Ns( self , metric_key ) : #NEWLINE# #INDENT# elements = list ( self . metric_counters [ metric_key ] . elements ( ) ) #NEWLINE# n_non_zero = len ( elements ) #NEWLINE# product_key = self . product_key_from_metric_key ( metric_key ) #NEWLINE# n_total = self . product_counter [ product_key ] #NEWLINE# if ( ( 'plosalm' in metric_key ) and ( ( 'pdf_views' in metric_key ) or ( 'html_views' in metric_key ) ) ) : #NEWLINE# #INDENT# n_zero = 0 #NEWLINE# n_total = n_non_zero #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# n_zero = ( n_total - n_non_zero ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'n_total' : n_total , #NEWLINE# 'n_zero' : n_zero , #NEWLINE# #UNINDENT# }