<commit_before><!--
    Amazon S3 Bucket listing.

    Copyright (C) 2008 <NAME>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

-->

// fetch list when document loaded
document.body.onload = getList;

function getSpace(s,l){
    var ret = "";
    while(s.length+ret.length<l){
      ret = ret + " ";
    }
    return ret;
}


location.querystring = (function() {
	// The return is a collection of key/value pairs
	var result = {};

	// Gets the query string with a preceeding '?'
	var querystring = location.search;

	// document.location.search is empty if a query string is absent
	if (!querystring)
		return result;

	// substring(1) to remove the '?'
	var pairs = querystring.substring(1).split("&");
	var splitPair;

	// Load the key/values of the return collection
	for (var i = 0; i < pairs.length; i++) {
		splitPair = pairs[i].split("=");
		result[splitPair[0]] = splitPair[1];
	}

	return result;
})();

function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* You can get more specific with version information by using
	parseInt(navigator.appVersion)
	Which will extract an integer value containing the version
	of the browser being used.
*/
/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject();
function getList(){
	http.open('get', location.protocol+'//'+location.hostname);
	http.onreadystatechange = handleList;
	http.send(null);
}

function handleList(){
	/* Make sure that the transaction has finished. The XMLHttpRequest object
		has a property called readyState with several states:
		0: Uninitialized
		1: Loading
		2: Loaded
		3: Interactive
		4: Finished */
	if(http.readyState == 4){ //Finished loading the response
		/* We have got the response from the server-side script,
			let's see just what it was. using the responseText property of
			the XMLHttpRequest object. */
		var response = http.responseXML;

filex = response.getElementsByTagName('Contents');


res = '';
fileList = new Array();
for(i=0; i<filex.length; i++){
        fileData =new Array();
        fileList[i] = fileData;
	size = filex[i].getElementsByTagName('Size')[0].firstChild.data;
	name = filex[i].getElementsByTagName('Key')[0].firstChild.data;
	lastmod = filex[i].getElementsByTagName('LastModified')[0].firstChild.data;
        link = "<A HREF=\""+name+"\">"+name+"</A>";
        fileData[0] = name;
        fileData[1] = size;
        fileData[2] = lastmod;
        fileData[3] = link;
}
fileList.sort(getSort());
//document.write(getSort());
for(i=0; i<fileList.length; i++){ //length is the same as count($array)
        fileData = fileList[i];
        name = fileData[0];
        size = fileData[1];
        lastmod = fileData[2];
        link = fileData[3];
        res = res +  getSpace(size,15) +size + " B ";
        res = res + " "+ getSpace(lastmod,20)+ lastmod + " ";
        res = res + " "+ link+ getSpace(name,50) + " ";
        res = res + "<BR>";
}


		document.getElementById('bucket_list').innerHTML = "<PRE>"+getLink()+"<BR>"+res+"</PRE>"  ;
	}
}


function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");<commit_msg>JS fix.<commit_after>/*
    Amazon S3 Bucket listing.

    Copyright (C) 2008 <NAME>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

// fetch list when document loaded
document.body.onload = getList;

function getSpace(s,l){
    var ret = "";
    while(s.length+ret.length<l){
      ret = ret + " ";
    }
    return ret;
}


location.querystring = (function() {
    // The return is a collection of key/value pairs
    var result = {};

    // Gets the query string with a preceeding '?'
    var querystring = location.search;

    // document.location.search is empty if a query string is absent
    if (!querystring)
        return result;

    // substring(1) to remove the '?'
    var pairs = querystring.substring(1).split("&");
    var splitPair;

    // Load the key/values of the return collection
    for (var i = 0; i < pairs.length; i++) {
        splitPair = pairs[i].split("=");
        result[splitPair[0]] = splitPair[1];
    }

    return result;
})();

function createRequestObject(){
    var request_o; //declare the variable to hold the object.
    var browser = navigator.appName; //find the browser name
    if(browser == "Microsoft Internet Explorer"){
        /* Create the object using MSIE's method */
        request_o = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        /* Create the object using other browser's method */
        request_o = new XMLHttpRequest();
    }
    return request_o; //return the object
}

/* You can get more specific with version information by using
    parseInt(navigator.appVersion)
    Which will extract an integer value containing the version
    of the browser being used.
*/
/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject();
function getList(){
    http.open('get', location.protocol+'//'+location.hostname);
    http.onreadystatechange = handleList;
    http.send(null);
}

function handleList(){
    /* Make sure that the transaction has finished. The XMLHttpRequest object
        has a property called readyState with several states:
        0: Uninitialized
        1: Loading
        2: Loaded
        3: Interactive
        4: Finished */
    if(http.readyState == 4){ //Finished loading the response
        /* We have got the response from the server-side script,
            let's see just what it was. using the responseText property of
            the XMLHttpRequest object. */
        var response = http.responseXML;

filex = response.getElementsByTagName('Contents');


res = '';
fileList = new Array();
for(i=0; i<filex.length; i++){
        fileData =new Array();
        fileList[i] = fileData;
    size = filex[i].getElementsByTagName('Size')[0].firstChild.data;
    name = filex[i].getElementsByTagName('Key')[0].firstChild.data;
    lastmod = filex[i].getElementsByTagName('LastModified')[0].firstChild.data;
        link = "<A HREF=\""+name+"\">"+name+"</A>";
        fileData[0] = name;
        fileData[1] = size;
        fileData[2] = lastmod;
        fileData[3] = link;
}
fileList.sort(getSort());
//document.write(getSort());
for(i=0; i<fileList.length; i++){ //length is the same as count($array)
        fileData = fileList[i];
        name = fileData[0];
        size = fileData[1];
        lastmod = fileData[2];
        link = fileData[3];
        res = res +  getSpace(size,15) +size + " B ";
        res = res + " "+ getSpace(lastmod,20)+ lastmod + " ";
        res = res + " "+ link+ getSpace(name,50) + " ";
        res = res + "<BR>";
}


        document.getElementById('bucket_list').innerHTML = "<PRE>"+getLink()+"<BR>"+res+"</PRE>"  ;
    }
}


function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
{'fraction_non_alphanumeric': 0.1244391971664699, 'fraction_numerical': 0.008736717827626918, 'mean_word_length': 3.1161321671525752, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7420622', 'n_tokens_mistral': 2556, 'n_tokens_neox': 2468, 'n_words': 838}