<commit_before>const fs = require("fs");
const uuid = require("uuid");
const request = require("sync-request");
const path = require("path");

const commandLineArgs = require("command-line-args");
const flags = JSON.parse(fs.readFileSync(path.join(__dirname, "flags.json"), "utf8"))
	.map((flag) => {
		if (flag.type === "String") flag.type = String;
		if (flag.type === "Number") flag.type = Number;
		if (flag.type === "Boolean") flag.type = Boolean;
		return flag;
	}
);
const argv = commandLineArgs(flags);

const directory = process.argv[3];

const urls = [];
const activeUrls = [];
const snippets = {};
const resources = {};
const files = [];

let latestUrl = "";

const logSnippet = function(filename, logContent, content) {
	snippets[filename] = logContent;
	fs.writeFileSync(directory + filename, content);
	fs.writeFileSync(directory + "snippets.json", JSON.stringify(snippets, null, "\t"));
};

module.exports = {
	directory,
	getUUID: uuid.v4,
	kill: function(message) {
		if (process.argv.indexOf("--no-kill") === -1) {
			console.trace(message);
			console.log("Exiting (use --no-kill to just simulate a runtime error).");
			process.exit(0);
		} else {
			throw new Error(message);
		}
	},<commit_msg>Fix wrong type for internal variable<commit_after>const fs = require("fs");
const uuid = require("uuid");
const request = require("sync-request");
const path = require("path");

const commandLineArgs = require("command-line-args");
const flags = JSON.parse(fs.readFileSync(path.join(__dirname, "flags.json"), "utf8"))
	.map((flag) => {
		if (flag.type === "String") flag.type = String;
		if (flag.type === "Number") flag.type = Number;
		if (flag.type === "Boolean") flag.type = Boolean;
		return flag;
	}
);
const argv = commandLineArgs(flags);

const directory = process.argv[3];

const urls = [];
const activeUrls = [];
const snippets = {};
const resources = {};
const files = {};

let latestUrl = "";

const logSnippet = function(filename, logContent, content) {
	snippets[filename] = logContent;
	fs.writeFileSync(directory + filename, content);
	fs.writeFileSync(directory + "snippets.json", JSON.stringify(snippets, null, "\t"));
};

module.exports = {
	directory,
	getUUID: uuid.v4,
	kill: function(message) {
		if (process.argv.indexOf("--no-kill") === -1) {
			console.trace(message);
			console.log("Exiting (use --no-kill to just simulate a runtime error).");
			process.exit(0);
		} else {
			throw new Error(message);
		}
	},
{'fraction_non_alphanumeric': 0.17922606924643583, 'fraction_numerical': 0.004073319755600814, 'mean_word_length': 4.63302752293578, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1144342', 'n_tokens_mistral': 830, 'n_tokens_neox': 795, 'n_words': 195}