#NEWLINE# def get_participant_message_counts( self , message_bank_messages , case ) : #NEWLINE# #INDENT# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for entry in message_bank_messages : #NEWLINE# #INDENT# result [ entry [ 'message' ] . _id ] = 0 #NEWLINE# #UNINDENT# participant_messages = self . get_participant_messages ( case ) #NEWLINE# for sms in participant_messages : #NEWLINE# #INDENT# if ( ( sms . xforms_session_couch_id is None ) and ( sms . direction == OUTGOING ) ) : #NEWLINE# #INDENT# if ( not sms . fri_message_bank_lookup_completed ) : #NEWLINE# #INDENT# add_metadata ( sms , message_bank_messages ) #NEWLINE# #UNINDENT# if ( sms . fri_message_bank_message_id in message_bank_messages ) : #NEWLINE# #INDENT# result [ sms . fri_message_bank_message_id ] += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return result