<commit_before>function Gist(element, client) {
    this.element = element;
    this.client = client;
    this.filename = this.element.getElementsByTagName('a')[1].textContent;
    this.language = this.getLanguage();
    this.code = this.getCode();

    if (this.language === 'invalid') return;

    this.element.innerHTML += controls;
    this.console = this.element.getElementsByClassName('console')[0];
    this.buttons = {
        run: {
            element: this.element.getElementsByTagName('button')[0],
            gist: this,
            onClick: function(handler) {
                this.element.gist = this.gist;
                this.element.addEventListener('click', handler);
            }
        },
        reset: {
            element: this.element.getElementsByTagName('button')[1],
            gist: this,
            onClick: function(handler) {
                this.element.gist = this.gist;
                this.element.addEventListener('click', handler);
            }
        }
    }
    this.buttons.run.onClick(function() {
        this.gist.run();
    });
    this.buttons.reset.onClick(function() {
       this.gist.flush();
    });
}

Gist.prototype.run = function() {
    this.client.run(this);
}

Gist.prototype.flush = function() {
    this.console.innerHTML = '';
}

Gist.prototype.getCode = function() {
    var lines = this.element.getElementsByClassName('line-data')[0]
                            .getElementsByClassName('line'),
        code  = '';

    for (var index = 0; index < lines.length; index++) {
        code += lines[index].textContent;
    }
    return code;
}

Gist.prototype.getLanguage = function() {
    for(var language in extensions) {
        var regex = new RegExp('^.*\.('+extensions[language]+')$');

        if (this.filename.match(regex)) return language;
    }
    return 'invalid';
}

Gist.prototype.addOutput = function(data) {
    var cssClass = '',
        style = '';

    switch (data.stream) {
        case 'status':
            data.chunk = '[Program exited with status: '+data.chunk+']';
            cssClass = 'pl-ent';
            break;
        case 'stderr':
            cssClass = 'pl-s1';
            break;
    }
    this.console.innerHTML += [
        '<span class="line '+cssClass+'">'+data.chunk+'</span>',
    ].join('');
}<commit_msg>remove useless variable in gist output<commit_after>function Gist(element, client) {
    this.element = element;
    this.client = client;
    this.filename = this.element.getElementsByTagName('a')[1].textContent;
    this.language = this.getLanguage();
    this.code = this.getCode();

    if (this.language === 'invalid') return;

    this.element.innerHTML += controls;
    this.console = this.element.getElementsByClassName('console')[0];
    this.buttons = {
        run: {
            element: this.element.getElementsByTagName('button')[0],
            gist: this,
            onClick: function(handler) {
                this.element.gist = this.gist;
                this.element.addEventListener('click', handler);
            }
        },
        reset: {
            element: this.element.getElementsByTagName('button')[1],
            gist: this,
            onClick: function(handler) {
                this.element.gist = this.gist;
                this.element.addEventListener('click', handler);
            }
        }
    }
    this.buttons.run.onClick(function() {
        this.gist.run();
    });
    this.buttons.reset.onClick(function() {
       this.gist.flush();
    });
}

Gist.prototype.run = function() {
    this.client.run(this);
}

Gist.prototype.flush = function() {
    this.console.innerHTML = '';
}

Gist.prototype.getCode = function() {
    var lines = this.element.getElementsByClassName('line-data')[0]
                            .getElementsByClassName('line'),
        code  = '';

    for (var index = 0; index < lines.length; index++) {
        code += lines[index].textContent;
    }
    return code;
}

Gist.prototype.getLanguage = function() {
    for(var language in extensions) {
        var regex = new RegExp('^.*\.('+extensions[language]+')$');

        if (this.filename.match(regex)) return language;
    }
    return 'invalid';
}

Gist.prototype.addOutput = function(data) {
    var cssClass = '';

    switch (data.stream) {
        case 'status':
            data.chunk = '[Program exited with status: '+data.chunk+']';
            cssClass = 'pl-ent';
            break;
        case 'stderr':
            cssClass = 'pl-s1';
            break;
    }
    this.console.innerHTML += [
        '<span class="line '+cssClass+'">'+data.chunk+'</span>',
    ].join('');
}
{'fraction_non_alphanumeric': 0.1534813537400302, 'fraction_numerical': 0.003017891787023065, 'mean_word_length': 2.150033944331297, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4955466', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1354, 'n_words': 236}