def get_run_summary(self, run_stats):
        """
        Produce a text summary from run statistics.

        :param run_stats: A dictionary containing run stats
        :return: Formatted multiline string
        """
        run_stats = run_stats.copy()
        run_stats['files'] = len(run_stats['files'])
        summary = [
            u'\n--- %s run summary ---' % __package__,
            u'Number of processed files: %(files)d',
            u'Total lines read: %(lines)d',
            u'Total log events matched: %(matches)d',
        ]
        if any([app.matches or app.unparsed for app in self.apps.values()]):
            if self.matcher == 'unruled':
                summary.append("Applications found (application rules not used):")
                for app in filter(lambda x: x.matches, self.apps.values()):
                    summary.append(u'  %s(matches=%d)' % (app.name, app.matches))
            else:
                summary.append("Applications found:")
                for app in filter(lambda x: x.matches or x.unparsed, self.apps.values()):
                    summary.append(u'  %s(matches=%d, unparsed=%s)' % (app.name, app.matches, app.unparsed))
        summary.append('\n')
        return '\n'.join(summary) % run_stats
Produce a text summary from run statistics.

        :param run_stats: A dictionary containing run stats
        :return: Formatted multiline string