<commit_before>"""
napkin like calculation for rough download cost estimates
prices from 5/15/2017

using 1000 convert instead of 1024
"""
from __future__ import print_function
from decimal import Decimal

ONE_MB = Decimal(10**6)
ONE_GB = ONE_MB * 1000
ONE_TB = ONE_GB * 1000
TEN_TB = ONE_TB * 10
FORTY_TB = ONE_TB * 40
ONE_HUNDRED_TB = ONE_TB * 100

LEVELS = [
    (ONE_GB, 0.000),
    (TEN_TB, 0.090),
    (FORTY_TB, 0.085),
    (ONE_HUNDRED_TB, 0.070)
]

def bytes_to_gb(num_bytes):

    return num_bytes / ONE_GB

def get_naive_price(num_bytes, price_str='.090'):
    """Naive price, up to 10GB"""
    #import ipdb; ipdb.set_trace()
    num_bytes = num_bytes - ONE_GB  #1st gb free

    if num_bytes < 0:
        return 0

    return (num_bytes / ONE_GB) * Decimal('.090')<commit_msg>price fix (should have been in last commit)<commit_after>"""
napkin like calculation for rough download cost estimates
prices from 5/15/2017

using 1000 convert instead of 1024
"""
from __future__ import print_function
from decimal import Decimal

ONE_MB = Decimal(10**6)
ONE_GB = ONE_MB * 1000
ONE_TB = ONE_GB * 1000
TEN_TB = ONE_TB * 10
FORTY_TB = ONE_TB * 40
ONE_HUNDRED_TB = ONE_TB * 100

LEVELS = [
    (ONE_GB, 0.000),
    (TEN_TB, 0.090),
    (FORTY_TB, 0.085),
    (ONE_HUNDRED_TB, 0.070)
]

def bytes_to_gb(num_bytes):

    return num_bytes / ONE_GB

def get_naive_price(num_bytes, price_str='.090'):
    """Naive price, up to 10GB"""
    #import ipdb; ipdb.set_trace()
    num_bytes = num_bytes - ONE_GB  #1st gb free

    if num_bytes < 0:
        return 0

    return (num_bytes / ONE_GB) * Decimal(price_str)
{'fraction_non_alphanumeric': 0.10627719080174021, 'fraction_numerical': 0.07271597265382225, 'mean_word_length': 3.5868945868945867, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2631362', 'n_tokens_mistral': 738, 'n_tokens_neox': 620, 'n_words': 172}