#NEWLINE# @ staticmethod #NEWLINE# def get_message_groups( messages ) : #NEWLINE# #INDENT# grouped_msgs = OrderedDict ( ) #NEWLINE# for message in messages : #NEWLINE# #INDENT# first_colon = message . find ( ':' ) #NEWLINE# first_space = message . find ( ' ' ) #NEWLINE# if ( ( first_space > 0 ) and ( first_space == ( first_colon + 1 ) ) ) : #NEWLINE# #INDENT# group = message [ : first_colon ] #NEWLINE# message = message [ ( first_space + 1 ) : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# group = 'Other' #NEWLINE# #UNINDENT# if ( group not in grouped_msgs ) : #NEWLINE# #INDENT# grouped_msgs [ group ] = [ ] #NEWLINE# #UNINDENT# grouped_msgs [ group ] . append ( message ) #NEWLINE# #UNINDENT# return grouped_msgs