<commit_before>#!/bin/env python
"""Prints the price of our car."""

import collections

#pylint: disable=superfluous-parens


def main():
    """Calculates the price of our car."""
    item_to_price = {
        'Tamiya Grasshopper RC Car': 89.41,
        '7.2V Tenergy 3800mAh NiMH battery': 26.99,
        'Raspberry Pi A+': 21.96,
        '2200 mAh USB battery': 16.99,
        'Raspberry Pi camera': 29.95,
        'Rosewill WiFi adapter': 5.99,
        '8 GiB microSDHC': 8.99,
        'jumper wires standard pack of 30': 4.95,
        'Velcro straps': 7.99,
        'NavSpark SUP800F GPS Antenna Module + 7-DOF IMU': 50.00,
    }

    item_to_price = collections.OrderedDict(sorted(item_to_price.items()))

    price_to_item = sorted(
        ((price, item) for item, price in item_to_price.items()),
        reverse=True
    )

    assert(len(item_to_price) == len(price_to_item))

    max_length = max((len(item) for item in item_to_price.keys()))
    format_string = '{{item: <{len_}}}${{price}}'.format(len_=max_length + 3)

    print('    *** By item ***')
    for item, price in item_to_price.items():
        print(format_string.format(item=item, price=price))
    print('')

    print('    *** By price ***')
    for price, item in price_to_item:
        print(format_string.format(item=item, price=price))<commit_msg>Add Raspberry Pi 2 to price<commit_after>#!/bin/env python
"""Prints the price of our car."""

import collections

#pylint: disable=superfluous-parens


def main():
    """Calculates the price of our car."""
    item_to_price = {
        'Tamiya Grasshopper RC Car': 89.41,
        '7.2V Tenergy 3800mAh NiMH battery': 26.99,
        'Raspberry Pi 2': 39.95,
        '2200 mAh USB battery': 16.99,
        'Raspberry Pi camera': 29.95,
        'Rosewill WiFi adapter': 5.99,
        '8 GiB microSDHC': 8.99,
        'jumper wires standard pack of 30': 4.95,
        'Velcro straps': 7.99,
        'NavSpark SUP800F GPS Antenna Module + 7-DOF IMU': 50.00,
    }

    item_to_price = collections.OrderedDict(sorted(item_to_price.items()))

    price_to_item = sorted(
        ((price, item) for item, price in item_to_price.items()),
        reverse=True
    )

    assert(len(item_to_price) == len(price_to_item))

    max_length = max((len(item) for item in item_to_price.keys()))
    format_string = '{{item: <{len_}}}${{price}}'.format(len_=max_length + 3)

    print('    *** By item ***')
    for item, price in item_to_price.items():
        print(format_string.format(item=item, price=price))
    print('')

    print('    *** By price ***')
    for price, item in price_to_item:
        print(format_string.format(item=item, price=price))
{'fraction_non_alphanumeric': 0.14456481135599553, 'fraction_numerical': 0.04109077325364214, 'mean_word_length': 2.915204678362573, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1281382', 'n_tokens_mistral': 1021, 'n_tokens_neox': 911, 'n_words': 236}