<commit_before>function find(data, args) {
	/* 
	Context: Given a JS object and a string, return as if string was an eval
	Example: find({"names": {"john":5, "stacy":34}}, ["names", "john"]) => 5}

	This is actually a cool little piece of code IMO. The recursion loops through each argument and applys them one by one to the data 
	*/
	if (args.length === 0){
		return data;
	}

	return find(data[args.shift()], args);
}

request = {

	error: function (msg) {
		return {'status': 'error', "data": msg} 
	},


	// Get request
	get: function(table, query) {
		// If it's just a table, they want a table.
		if (query === undefined) {
			return table;
		}

		// Else, they have an actual request
		else {
			return find(table, query);
		}
	},

	// Put request
	put: function(table, query) {
		if (query === undefined || query.length != 2) {
			return error("bad query");
		}

		else {
			
			return table;
		}
	},

	// Save request
	save: function(table) {
		return "failed";
	}
}

module.exports = request;<commit_msg>Added a note to myself for later<commit_after>function find(data, args) {
	/* 
	Context: Given a JS object and a string, return as if string was an eval
	Example: find({"names": {"john":5, "stacy":34}}, ["names", "john"]) => 5}

	This is actually a cool little piece of code IMO. The recursion loops through each argument and applys them one by one to the data 
	*/
	if (args.length === 0){
		return data;
	}

	return find(data[args.shift()], args);
}

request = {

	error: function (msg) {
		return {'status': 'error', "data": msg} 
	},


	// Get request
	get: function(table, query) {
		// If it's just a table, they want a table.
		if (query === undefined) {
			return table;
		}

		// Else, they have an actual request
		else {
			return find(table, query);
		}
	},

	// Put request
	put: function(table, query) {
		if (query === undefined || query.length != 2) {
			return error("bad query");
		}

		else {
			//REUSE FIND CODE WITH SET. every level "equals" the next, until we hit path, then equals to args
		}
	},

	// Save request
	save: function(table) {
		return "failed";
	}
}

module.exports = request;
{'fraction_non_alphanumeric': 0.1474870831376233, 'fraction_numerical': 0.0056364490371066224, 'mean_word_length': 3.111969111969112, 'pattern_counts': {'":': 8, '<': 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': '1812048', 'n_tokens_mistral': 783, 'n_tokens_neox': 693, 'n_words': 261}