<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def summary(processors, metrics, context):
 """Print the summary"""

    # display aggregated metric values on language level
    def display_header(processors, before='', after=''):
        """Display the header for the summary results."""
        print(before, end=' ')
        for processor in processors:
            processor.display_header()
        print(after)

    def display_separator(processors, before='', after=''):
        """Display the header for the summary results."""
        print(before, end=' ')
        for processor in processors:
            processor.display_separator()
        print(after)

    def display_metrics(processors, before='', after='', metrics=[]):
        """Display the header for the summary results."""
        print(before, end=' ')
        for processor in processors:
            processor.display_metrics(metrics)
        print(after)

    summary = {}
    for m in metrics:
        lang = metrics[m]['language']
        has_key = lang in summary
        if not has_key:
            summary[lang] = {'file_count': 0, 'language': lang}
        summary[lang]['file_count'] += 1
        for i in metrics[m]:
            if i not in ['sloc', 'comments', 'mccabe']:  # include metrics to be used
                continue
            if not has_key:
                summary[lang][i] = 0
            summary[lang][i] += metrics[m][i]

    total = {'language': 'Total'}
    for m in summary:
        for i in summary[m]:
            if i == 'language':
                continue
            if i not in total:
                total[i] = 0
            total[i] += summary[m][i]

    print('Metrics Summary:')

    display_header(processors, 'Files', '')
    display_separator(processors, '-'*5, '')
    for k in sorted(summary.keys(), key=str.lower):
        display_metrics(processors, '%5d' %
                        summary[k]['file_count'], '', summary[k])
    display_separator(processors, '-'*5, '')
    display_metrics(processors, '%5d' % total['file_count'],
                    '', total)