<commit_before>
var input = "";
var x = 10;

function evaluateThis(){
	input = document.getElementById("screen").innerHTML;
	while(replaceCaret(input))
	{
		//Do nothing.
		//This loops so that every caret is found and replaced.
	}
	var output = eval(input);
	document.getElementById("results").innerHTML = output;
}

function mapper(leftBound, rightBound, stepSize){
	input = document.getElementById("screen").innerHTML;
	var arrayMap = [];
	var y = 0;
	while(replaceCaret(input))
	{
		//Do nothing.
		//This loops so that every caret is found and replaced.
	}
	
	//Start at left bound, go to right bound in steps of size stepSize.
	for(i=leftBound; i<rightBound+stepSize; i+=stepSize)
	{
		var tuple = {};
		//This line assumes 'x' is used as the variable in the input from the html.
		x = i;
		y = eval(input);

		tuple.x = i;
		tuple.y = y
		arrayMap.push(tuple);
	}
	
	return arrayMap;
}

//This function looks for carets, matches them to an x^a expression, and replaces that expression with its numerical value.
function replaceCaret(){
	var caretIndex = input.indexOf("^");
	if(caretIndex == -1)
	{
		//Since we found no caret, we return false.
		return false;<commit_msg>move replaceCaret loop inside mapper<commit_after>
var input = "";
var func = "";
var x = 10;

function evaluateThis(){
	input = document.getElementById("screen").innerHTML;
	while(replaceCaret(input))
	{
		//Do nothing.
		//This loops so that every caret is found and replaced.
	}
	var output = eval(input);
	document.getElementById("results").innerHTML = output;
}

function mapper(leftBound, rightBound, stepSize){
	input = document.getElementById("screen").innerHTML;
	func = document.getElementById("screen").innerHTML;
	var arrayMap = [];
	var y = 0;

	
	//Start at left bound, go to right bound in steps of size stepSize.
	for(i=leftBound; i<rightBound+stepSize; i+=stepSize)
	{

		var tuple = {};
		//This line assumes 'x' is used as the variable in the input from the html.
		x = i;

		while(replaceCaret(input))
		{
			//Do nothing.
			//This loops so that every caret is found and replaced.
		}

		y = eval(input);

		tuple.x = i;
		tuple.y = y
		arrayMap.push(tuple);

		input = func;
	}
	
	return arrayMap;
}

//This function looks for carets, matches them to an x^a expression, and replaces that expression with its numerical value.
function replaceCaret(){
	var caretIndex = input.indexOf("^");
	if(caretIndex == -1)
	{
		//Since we found no caret, we return false.
		return false;
{'fraction_non_alphanumeric': 0.12282828282828283, 'fraction_numerical': 0.0032323232323232323, 'mean_word_length': 3.7251908396946565, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3657784', 'n_tokens_mistral': 836, 'n_tokens_neox': 772, 'n_words': 273}