<commit_before># encoding: utf-8

# included for ease of use with Python 2 (which has no statistics package)


def mean(values):
    return float(sum(values)) / len(values)

def quantile(p):
    def bound_quantile(values):
        ix = int(len(values) * p)

        if len(values) % 2:
            return values[ix]
        elif ix < 1:
            return values[0]
        else:
            return mean(values[ix - 1:ix + 1])

    return bound_quantile

Q0 = min
Q1 = quantile(0.25)
Q2 = median = quantile(0.5)
Q3 = quantile(0.75)
Q4 = max
<commit_msg>Fix bug in quantile statistics.<commit_after># encoding: utf-8

# included for ease of use with Python 2 (which has no statistics package)


def mean(values):
    sigma = float(sum(values))
    n = len(values)
    return sigma / n

def quantile(p):
    def bound_quantile(values):
        values = sorted(values)
        n = len(values)
        ix = int(n * p)

        if n % 2:
            return values[ix]
        elif ix < 1:
            return values[0]
        else:
            return mean(values[ix - 1:ix + 1])

    return bound_quantile

Q0 = min
Q1 = quantile(0.25)
Q2 = median = quantile(0.5)
Q3 = quantile(0.75)
Q4 = max

{'fraction_non_alphanumeric': 0.11195286195286196, 'fraction_numerical': 0.03367003367003367, 'mean_word_length': 2.2309782608695654, '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': '882807', 'n_tokens_mistral': 428, 'n_tokens_neox': 401, 'n_words': 124}