<commit_before>
function getQueryVariable(variable) {
    // from http://stackoverflow.com/a/2091331/1320237
    var query = window.location.search.substring(1);
    var vars = query.split('&');
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split('=');
        if (decodeURIComponent(pair[0]) == variable) {
            return decodeURIComponent(pair[1]);
        }
    }
    alert('Query variable ' + variable + ' not found.');
}

var build_server = getQueryVariable("build_server");
var status_path = getQueryVariable("status");
var build_status_url = build_server + status_path;

function request_status_update() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      var status = JSON.parse(this.responseText);
      update_progress(status);
    }
  };
  xhttp.open("GET", build_status_url, true);
  xhttp.send();
}

function update_progress(progress) {
  var download_button = document.getElementById("download-button");
  var download_link = document.getElementById("download-link");
  var progress_div = document.getElementById("progress");
  if (progress.status == "stopped") {
    if (progress.url) {
      download_button.textContent = "CLICK TO DOWNLOAD";
      download_link.href = progress.url;
    } else {<commit_msg>fixed bug: download link did not work<commit_after>
function getQueryVariable(variable) {
    // from http://stackoverflow.com/a/2091331/1320237
    var query = window.location.search.substring(1);
    var vars = query.split('&');
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split('=');
        if (decodeURIComponent(pair[0]) == variable) {
            return decodeURIComponent(pair[1]);
        }
    }
    alert('Query variable ' + variable + ' not found.');
}

var build_server = getQueryVariable("build_server");
var status_path = getQueryVariable("status");
var build_status_url = build_server + status_path;

function request_status_update() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      var status = JSON.parse(this.responseText);
      update_progress(status);
    }
  };
  xhttp.open("GET", build_status_url, true);
  xhttp.send();
}

function update_progress(progress) {
  var download_button = document.getElementById("download-button");
  var download_link = document.getElementById("download-link");
  var progress_div = document.getElementById("progress");
  if (progress.status == "stopped") {
    if (progress.download) {
      download_button.textContent = "CLICK TO DOWNLOAD";
      download_link.href = build_server + progress.download;
    } else {
{'fraction_non_alphanumeric': 0.13904134650567143, 'fraction_numerical': 0.01609952433223564, 'mean_word_length': 3.788091068301226, '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': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6510406', 'n_tokens_mistral': 842, 'n_tokens_neox': 821, 'n_words': 177}