<commit_before>// --- LIBRARY CODE ----------------------------------------------

var APP = (typeof APP != "undefined") ? APP : {

	overrides: {},

	override: function(ns, plan) {
		overrides[ns] = plan;
	},

	exec: function(params) {

	    var strNS = params.ns;
		var ns = {};
	    var sectors = strNS.split('.');

	    for (var i = 0; i < sectors.length; i++) {
			var sector = sectors[i];

			if (i == 0 && !window[sector]) {
				window[sector] = {};
				ns = window[sector];
			}
			else {
				ns = (ns[sector] ? ns[sector] : {});
			}
	    }

		var self = this;
		var methods = (typeof APP.overrides[ns] == "undefined") ? 
			params.plan : APP.overrides[ns];

		for(method in methods) {
			if(Object.prototype.toString.call(methods[method]) == "[object Array]") {
				self[methods[method][0]].call(self, methods[method].slice(1, methods[method].length));
			}
			else {
				self[methods[method]].call(self);			
			}
		}

		delete this.Main;
		return (ns = this);
	}
};

// --- APPLICATION CODE ----------------------------------------------

 (function() {

	/* private */

		/* code... */

	/* public */ return {

		Main: function() { /* the main entry point for the program, is fired automatically. */

			APP.exec.call(this, {
			/* some sugar to take care of namespacing, execution-context and code orginization. */

				ns: "myNS.foobar.bazz", /* the namespace that this code structure should be stored in. */

				plan: [ /* an array of names of functions that will be executed. */

					["UnitOne", "foo", 13, function() {}] /* sample parameters */
					,"UnitTwo"
					,"UnitThree"
				]
			});
		},

		UnitOne: function(args) {
			/* code... */
		},

		UnitTwo: function() {
			/* code... */
		},

		UnitThree: function() {
			/* code... */
		}					

	}
})().Main();<commit_msg>after thoughts<commit_after>// --- LIBRARY CODE ----------------------------------------------

var APP = (typeof APP != "undefined") ? APP : {

	overrides: {},

	override: function(ns, plan) {
		overrides[ns] = plan;
	},

	exec: function(params) {

	    var strNS = params.ns;
		var ns = {};
	    var sectors = strNS.split('.');

	    for (var i = 0; i < sectors.length; i++) {
			var sector = sectors[i];

			if (i == 0 && !window[sector]) {
				window[sector] = {};
				ns = window[sector];
			}
			else {
				ns = ns[sector] = (ns[sector] ? ns[sector] : {});
			}
	    }
	
		delete this.Main;
		eval(params.ns + " = this;");

		var self = this;
		var methods = (typeof APP.overrides[ns] == "undefined") ? 
			params.plan : APP.overrides[ns];

		for(method in methods) {
			if(Object.prototype.toString.call(methods[method]) == "[object Array]") {
				self[methods[method][0]].call(self, methods[method].slice(1, methods[method].length));
			}
			else {
				self[methods[method]].call(self);			
			}
		}
	}
};

// --- APPLICATION CODE ----------------------------------------------

 (function() {

	/* private */

		/* code... */

	/* public */ return {

		Main: function() { /* the main entry point for the program, is fired automatically. */

			APP.exec.call(this, {
			/* some sugar to take care of namespacing, execution-context and code orginization. */

				ns: "myNS.foobar.bazz", /* the namespace that this code structure should be stored in. */

				plan: [ /* an array of names of functions that will be executed. */

					["UnitOne", "foo", 13, function() {}] /* sample parameters */
					,"UnitTwo"
					,"UnitThree"
				]
			});
		},

		UnitOne: function(args) {
			//console.log("asd")
			console.dir(myNS.foobar.bazz)
		},

		UnitTwo: function() {
			/* code... */
		},

		UnitThree: function() {
			/* code... */
		}					

	}
})().Main();
{'fraction_non_alphanumeric': 0.23022173555981384, 'fraction_numerical': 0.0032849712565015056, 'mean_word_length': 2.0966101694915253, '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': '5765293', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1171, 'n_words': 289}