<commit_before>"use strict";

var assert = require("assert");
var vm = require("vm");
var esprima = require("esprima");
var escodegen = require("escodegen");

var push = Array.prototype.push;
var unshift = Array.prototype.unshift;

function extend(destination, source) {
	if(source !== undefined) {
		Object.keys(source).forEach(function(key) {
			destination[key] = source[key];
		});
	}

	return destination;
}

var voidTags = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];

var amp = /&/g;
var lt = /</g;
var gt = />/g;
var quot = /"/g;

function escapeText(text) {
	return text.replace(amp, "&amp;")
	           .replace(lt, "&lt;")
	           .replace(gt, "&gt;");
}

function escapeAttributeText(text) {
	return text.replace(amp, "&amp;")
	           .replace(quot, "&quot;");
}

function LiteralString(content) {
	this.content = content;
}

function scriptToFunction(script) {
	var stack = [];
	var program = esprima.parse(script);
	var current = program.body;

	var makeReturn = function(statement) {
		statement.expression = {
			type: "AssignmentExpression",
			operator: "=",
			left: {
				type: "Identifier",
				name: "__retval"
			},
			right: statement.expression
		};
	};

	do {
		var lastExpressionStatement = null;

		current.forEach(function(item) {
			if(item.type === "ExpressionStatement") {
				lastExpressionStatement = item;
			}

			if(item.body) {
				if(Array.isArray(item.body)) {
					stack.push(item.body);
				} else {
					stack.push([item.body]);
				}
			}

			if(item.consequent) {<commit_msg>Functions’ contents no longer affect __retval.<commit_after>"use strict";

var assert = require("assert");
var vm = require("vm");
var esprima = require("esprima");
var escodegen = require("escodegen");

var push = Array.prototype.push;
var unshift = Array.prototype.unshift;

function extend(destination, source) {
	if(source !== undefined) {
		Object.keys(source).forEach(function(key) {
			destination[key] = source[key];
		});
	}

	return destination;
}

var voidTags = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];

var amp = /&/g;
var lt = /</g;
var gt = />/g;
var quot = /"/g;

function escapeText(text) {
	return text.replace(amp, "&amp;")
	           .replace(lt, "&lt;")
	           .replace(gt, "&gt;");
}

function escapeAttributeText(text) {
	return text.replace(amp, "&amp;")
	           .replace(quot, "&quot;");
}

function LiteralString(content) {
	this.content = content;
}

function scriptToFunction(script) {
	var stack = [];
	var program = esprima.parse(script);
	var current = program.body;

	var makeReturn = function(statement) {
		statement.expression = {
			type: "AssignmentExpression",
			operator: "=",
			left: {
				type: "Identifier",
				name: "__retval"
			},
			right: statement.expression
		};
	};

	do {
		var lastExpressionStatement = null;

		current.forEach(function(item) {
			if(item.type === "FunctionDeclaration") {
				return;
			}

			if(item.type === "ExpressionStatement") {
				lastExpressionStatement = item;
			}

			if(item.body) {
				if(Array.isArray(item.body)) {
					stack.push(item.body);
				} else {
					stack.push([item.body]);
				}
			}

			if(item.consequent) {
{'fraction_non_alphanumeric': 0.18097238895558224, 'fraction_numerical': 0.0, 'mean_word_length': 3.622746185852982, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '707610', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1129, 'n_words': 246}