def _dump_shape_stats(stats, whitelist, out_lines, diff_type, multiple_fonts):
    """Dump stats accumulated from calls to _shape.

    Members of stats are passed in with sortable ordering, but are re-ordered
    for printing. whitelist, out_lines, and diff_type are passed through from
    the original call to fontdiff. multiple_fonts designates whether these stats
    have been accumulated from multiple calls or just one; if multiple then the
    font names from each stats member will be printed as well.
    """

    if not stats:
        print 'No differences found.'
        return

    if whitelist:
        stats = [s for s in stats if s[1] not in whitelist]
    stats.sort()
    stats.reverse()

    stat_format = '%s %s'

    # include individual font names if multiple pairs of fonts were compared
    if multiple_fonts:
        stat_format = '%s ' + stat_format

    # include actual area values if areas were compared
    if diff_type == 'area':
        stat_format += ' (%s vs %s)'

    for stat in stats[:out_lines]:

        # print <font> <glyph> <vals>; stats are sorted in reverse priority
        stat = tuple(list(reversed(stat[:3])) + list(stat[3:]))

        # ignore font name if just one pair of fonts was compared
        if not multiple_fonts:
            stat = stat[1:]
        print stat_format % stat
dataset/ETHPy150Open googlei18n/nototools/nototools/fontdiff.py/_dump_shape_stats/original