<commit_before>// Utilities
// =========
//
// ObjectList
// ----------
//
// A list of Object.
function ObjectList(size) {
    var items = {};
    this.size = size;
    this.length = 0;

    this.append = function(item) {
        if (this.size === this.length) {
            throw new Error('ObjectList overflow');
        }

        items[this.length] = item;
        this.length++;

        return item;
    };

    this.get = function(index) {
        var key;
        var counter = 0;

        if (index >= this.length) {
            return undefined;
        }

        for (key in items) {
            if (counter === index) {
                return items[key];
            }

            counter += 1;
        }

        return undefined;
    };

    this.getAll = function() {
        return items;
    };

    this.each = function(callback) {
        var i = 0;

        if (this.length === 0) {
            return false;
        }

        while (i < this.length) {
            callback(items[i]);
            i += 1;
        }
    };

    this.remove = function(index) {
        var item;
        var key;
        var counter = 0;

        if (index >= length) {
            return undefined;
        }

        for (key in items) {
            if (counter === index) {
                item = items[key];

                items[index] = null;
                delete(items[index]);
                this.length -= 1;

                return item;
            }

            counter += 1;
        }

        return undefined;
    };

    this.pop = function() {
        return this.remove(this.length);
    };
}

function getTypeAndQ(typeString) {
    var bits;
    var q;

    if (typeString.indexOf(';') > -1) {
        bits = typeString.split(';');
        q = bits[1].split('q=')[1];

        return {
            'type': bits[0],
            'q': parseFloat(q, 10)
        };<commit_msg>Removed _this hack<commit_after>// Utilities
// =========
//
// ObjectList
// ----------
//
// A list of Object.
function ObjectList(size) {
    var items = {};
    this.size = size;
    this.length = 0;

    this.append = function(item) {
        if (this.size === this.length) {
            throw new Error('ObjectList overflow');
        }

        items[this.length] = item;
        this.length++;

        return item;
    };

    this.get = function(index) {
        var key;
        var counter = 0;

        if (index >= this.length) {
            return undefined;
        }

        for (key in items) {
            if (counter === index) {
                return items[key];
            }

            counter += 1;
        }

        return undefined;
    };

    this.getAll = function() {
        return items;
    };

    this.each = function(callback, ctx) {
        var i = 0;

        if (this.length === 0) {
            return false;
        }

        while (i < this.length) {
            callback.call(ctx || this, items[i]);
            i += 1;
        }
    };

    this.remove = function(index) {
        var item;
        var key;
        var counter = 0;

        if (index >= length) {
            return undefined;
        }

        for (key in items) {
            if (counter === index) {
                item = items[key];

                items[index] = null;
                delete(items[index]);
                this.length -= 1;

                return item;
            }

            counter += 1;
        }

        return undefined;
    };

    this.pop = function() {
        return this.remove(this.length);
    };

    this.update = function(oList) {
        oList.each(function(item) {
            this.append(item);
        }, this);
    };
}

function getTypeAndQ(typeString) {
    var bits;
    var q;

    if (typeString.indexOf(';') > -1) {
        bits = typeString.split(';');
        q = bits[1].split('q=')[1];

        return {
            'type': bits[0],
            'q': parseFloat(q, 10)
        };
{'fraction_non_alphanumeric': 0.1437231624147512, 'fraction_numerical': 0.007577671129072998, 'mean_word_length': 1.2297297297297298, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2702131', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1126, 'n_words': 272}