def to_terminal(self):
        '''Yield lines to be printed to a terminal.'''
        sum_metrics = collections.defaultdict(int)
        for path, mod in self.results:
            if 'error' in mod:
                yield path, (mod['error'],), {'error': True}
                continue
            yield path, (), {}
            for header in self.headers:
                value = mod[header.lower().replace(' ', '_')]
                yield '{0}: {1}', (header, value), {'indent': 1}
                sum_metrics[header] += value

            loc, comments = mod['loc'], mod['comments']
            yield '- Comment Stats', (), {'indent': 1}
            yield ('(C % L): {0:.0%}', (comments / (float(loc) or 1),),
                   {'indent': 2})
            yield ('(C % S): {0:.0%}', (comments / (float(mod['sloc']) or 1),),
                   {'indent': 2})
            yield ('(C + M % L): {0:.0%}',
                   ((comments + mod['multi']) / (float(loc) or 1),),
                   {'indent': 2})

        if self.config.summary:
            yield '** Total **', (), {}
            for header in self.headers:
                yield '{0}: {1}', (header, sum_metrics[header]), {'indent': 1}
dataset/ETHPy150Open rubik/radon/radon/cli/harvest.py/RawHarvester.to_terminal/original