<commit_before>function arithmetic_mean(arr) {
    return sum(arr) / arr.length;
}

function geometric_mean(arr) {
    return Math.pow(prod(arr), 1 / arr.length);
}

function harmonic_mean(arr) {
    return arr.length / sum(arr.map(function(n) {
        return 1 / n;
    }));
}

function sum(arr) {
    return arr.reduce(function(acc, n) {
        return acc + n;
    });
}

function prod(arr) {
    return arr.reduce(function(acc, n) {
        return acc * n;<commit_msg>Added generalized mean<commit_after>function arithmetic_mean(arr) {
    return sum(arr) / arr.length;
}

function geometric_mean(arr) {
    return Math.pow(prod(arr), 1 / arr.length);
}

function harmonic_mean(arr) {
    return arr.length / sum(arr.map(function(n) {
        return 1 / n;
    }));
}

function generalized_mean(arr, power) {
    return Math.pow((1 / arr.length) * sum(arr.map(function(n) {
        return Math.pow(n, power);
    })), 1 / power);
}

function sum(arr) {
    return arr.reduce(function(acc, n) {
        return acc + n;
    });
}

function prod(arr) {
    return arr.reduce(function(acc, n) {
        return acc * n;
{'fraction_non_alphanumeric': 0.15013404825737264, 'fraction_numerical': 0.005361930294906166, 'mean_word_length': 2.902439024390244, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4804767', 'n_tokens_mistral': 398, 'n_tokens_neox': 385, 'n_words': 83}