<commit_before>
$(".btn-yes").click(function(e){
    $(this).toggleClass("btn-default btn-success");
});

$(".btn-no").click(function(e){
    $(this).toggleClass("btn-default btn-danger");
});

$(".btn-unsure").click(function(e){
    $(this).toggleClass("btn-default btn-warning");
});

var setupNewSurveyForm = function(data) {
	var samplingdata = data;

	var first_sample = samplingdata;
	var sample_iati_identifier = first_sample["iati-identifier"];
	var elt = $("#data-iati-identifier");
    elt.html(sample_iati_identifier);
    $("#sampling-container")[0].data = first_sample;
};

var getNewData = function() {
	$.getJSON("/api/sampling", function(data) { 
        setupNewSurveyForm(data);
	});
};

$(document).ready(function(){
	getNewData();
});

$(".advance").click(function(e) {
    var data = $("#sampling-container")[0].data;
    $.post("/api/sampling/process/", data, function(returndata){
		getNewData();
    });
});
<commit_msg>rm duped vars<commit_after>
$(".btn-yes").click(function(e){
    $(this).toggleClass("btn-default btn-success");
});

$(".btn-no").click(function(e){
    $(this).toggleClass("btn-default btn-danger");
});

$(".btn-unsure").click(function(e){
    $(this).toggleClass("btn-default btn-warning");
});

var setupNewSurveyForm = function(work_item) {
	var sample_iati_identifier = work_item["iati-identifier"];
	var elt = $("#data-iati-identifier");
    elt.html(sample_iati_identifier);
    $("#sampling-container")[0].data = work_item;
};

var getNewData = function() {
	$.getJSON("/api/sampling", function(data) { 
        setupNewSurveyForm(data);
	});
};

$(document).ready(function(){
	getNewData();
});

$(".advance").click(function(e) {
    var data = $("#sampling-container")[0].data;
    $.post("/api/sampling/process/", data, function(returndata){
		getNewData();
    });
});

{'fraction_non_alphanumeric': 0.22453450164293537, 'fraction_numerical': 0.002190580503833516, 'mean_word_length': 4.893548387096774, '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': '1672253', 'n_tokens_mistral': 637, 'n_tokens_neox': 617, 'n_words': 84}