<commit_before>function uploadFile(file, progressCallback, loadCallback) {
    var formData = new FormData();
    formData.append('inputFile', file);

    var xhr = new XMLHttpRequest();

    xhr.open('post', '/upload', true);

    xhr.upload.onprogress = function(e) {
        if (progressCallback && e.lengthComputable) {
            var percentage = (e.loaded / e.total) * 100;
            progressCallback(percentage);
        }
    };

    xhr.onerror = function(e) {
        alert('An error occurred while uploading file');
    };

    xhr.onload = function() {
        if (loadCallback) {
            loadCallback(this.statusText, JSON.parse(this.response));
        }
    };

    xhr.send(formData);
}

function changeProgress($element, percent) {
    var progressBarWidth = percent * $element.width() / 100;
    $element.find('div').animate({
        width: progressBarWidth
    }, 500).html(percent + "% ");
}<commit_msg>Round percentage<commit_after>function uploadFile(file, progressCallback, loadCallback) {
    var formData = new FormData();
    formData.append('inputFile', file);

    var xhr = new XMLHttpRequest();

    xhr.open('post', '/upload', true);

    xhr.upload.onprogress = function(e) {
        if (progressCallback && e.lengthComputable) {
            var percentage = Math.round((e.loaded / e.total) * 100);
            progressCallback(percentage);
        }
    };

    xhr.onerror = function(e) {
        alert('An error occurred while uploading file');
    };

    xhr.onload = function() {
        if (loadCallback) {
            loadCallback(this.statusText, JSON.parse(this.response));
        }
    };

    xhr.send(formData);
}

function changeProgress($element, percent) {
    var progressBarWidth = percent * $element.width() / 100;
    $element.find('div').animate({
        width: progressBarWidth
    }, 500).html(percent + "% ");
}
{'fraction_non_alphanumeric': 0.14224826851358552, 'fraction_numerical': 0.009589770911028236, 'mean_word_length': 2.718811881188119, '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': '3489271', 'n_tokens_mistral': 577, 'n_tokens_neox': 541, 'n_words': 111}