def METHOD_NAME(prefix_counts):
  """Outputs the given prefix counts and percentages as text.
  Args:
      prefix_counts: A dictionary of dictionaries, where keys to the outer
          dictionary are ISO 639 language names (e.g., 'pt') or the special
          string TOTAL, used to indicate the total number of messages.  Keys
          of the inner dictionaries are prefixes (app names or "apps"), and
          values are their count for the given language.
  """
  def generate_number_as_percent(num, total):
    return ('{:.0f} ({:.0%})'.format(num, num / total))
  MAX_WIDTH = len('999 (100%)') + 1
  FIELD_STRING = '{0: <' + str(MAX_WIDTH) + '}'
  apps = list(prefix_counts[TOTAL])
  apps.remove('ALL')
  apps.sort()
  apps.append('ALL')
  print(FIELD_STRING.format('Language') + ''.join(
      [FIELD_STRING.format(app) for app in apps]))
  print(('-' * (MAX_WIDTH - 1) + ' ') * (len(apps) + 1))
  for lang in prefix_counts:
    if lang != TOTAL:
      print(FIELD_STRING.format(lang) +
            ''.join([FIELD_STRING.format(generate_number_as_percent(
                prefix_counts[lang].get(app, 0),
                prefix_counts[TOTAL][app])) for app in apps]))