def _get_totals_row(slocgroup):
    """Returns the row for TOTALS."""
    totallines = slocgroup.totallines
    def average(key):
        total = totallines(key)
        return total / len(slocgroup.filenamesToSlocInfos)
    return ['TOTALS',
             totallines('code'), average('codeperc'),
             totallines('comment'), average('commentperc'),
             totallines('blank'), average('blankperc'),
             totallines('total'), totallines('totalperc')]