@decorators.null_logger
def prepare(counter, argv, elapsed_time = None, logger=None):

    blue = '\033[94m'
    grey = '\033[0m'
    endcolor = '\033[0m'
    italic = '\x1B[3m'
    eitalic = '\x1B[23m'

    template = '{0:>7.2%} {3}{2}{4}'

    if argv.show_absolute > 0:
        template = '{0:>7.2%} {3}{2}{4} ({1})'

    sum_lines = sum(counter.values())
    prepared_lines = []

    for author, contributions in sorter(counter, argv):

        relative = float(contributions) / float(sum_lines)

        output = template.format(relative, contributions, author, blue,
                                 endcolor, italic, eitalic)

        prepared_lines.append(output)

    top_n = check_top_n(counter, argv)
    n_contributors = 'Showing {}/{} contributors'.format(top_n, len(counter))
    elapsed ='Elapsed time: {}'.format(datetime.timedelta(seconds=elapsed_time))

    logger.info(n_contributors)
    logger.info(elapsed)

    prepared_lines.append('{}, {}'.format(n_contributors, elapsed))

    return prepared_lines
dataset/ETHPy150Open moacirosa/git-current-contributors/blame_relative_count/presenter.py/prepare/original