#NEWLINE# def get_frequency( self , key , participant_identifier ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# cache_key = ( COUNTER_CACHE_KEY % key ) #NEWLINE# freq = self . _redis . hget ( cache_key , participant_identifier ) #NEWLINE# return ( int ( freq ) if freq else 0 ) #NEWLINE# #UNINDENT# except ( ConnectionError , ResponseError ) : #NEWLINE# #INDENT# return 0