def report_messages_stats(sect, stats, _):
 if (not stats['by_msg']):
  raise utils.EmptyReport()
 in_order = sorted([(value, msg_id) for (msg_id, value) in six.iteritems(stats['by_msg']) if (not msg_id.startswith('I'))])
 in_order.reverse()
 lines = ('message id', 'occurrences')
 for (value, msg_id) in in_order:
  lines += (msg_id, str(value))
 sect.append(ureports.Table(children=lines, cols=2, rheaders=1))

def report_messages_stats ( sect , stats , _ ) : if ( not stats [ 'by_msg' ] ) : raise utils . EmptyReport ( ) in_order = sorted ( [ ( value , msg_id ) for ( msg_id , value ) in six . iteritems ( stats [ 'by_msg' ] ) if ( not msg_id . startswith ( 'I' ) ) ] ) in_order . reverse ( ) lines = ( 'message id' , 'occurrences' ) for ( value , msg_id ) in in_order : lines += ( msg_id , str ( value ) ) sect . append ( ureports . Table ( children = lines , cols = 2 , rheaders = 1 ) )
make messages type report .