<commit_before>(function() {

  	var rsplit = function(string, regex) {
  		
		var result = regex.exec(string),
			retArr = [], 
			first_idx, 
			last_idx, 
			first_bit,
			rsplit_idx = 0;

		while (result != null) {
			first_idx = result.index; 
			last_idx = regex.lastIndex;
			if ((first_idx) != 0) {
				first_bit = string.substring(0,first_idx);
				retArr[rsplit_idx++] = string.substring(0,first_idx);
				string = string.slice(first_idx);
			}		
			retArr[rsplit_idx++] = result[0];
			string = string.slice(result[0].length);
			result = regex.exec(string);
				
		}

		if (! string == '') {
			retArr[rsplit_idx++] = string;
		}
		return retArr;
	}

	var chop =  function(string) {
		return string.substr(0, string.length - 1);
	}

	var extend = function(d, s) {
		for(var n in s) {
			if (s.hasOwnProperty(n))  d[n] = s[n];
		}
	}

	EJSpeed = function(options) {
		options = typeof options == "string" ? {view: options} : options
		this.set_options(options);
		if (options.precompiled) {
			this.template = {};
			this.template.process = options.precompiled;
			EJSpeed.update(this.name, this);
			return;
		}
		if (options.element) {
			if (typeof options.element == 'string') {
				var name = options.element
				options.element = document.getElementById( options.element);
				if (options.element == null) throw name+'does not exist!';
			}
			if (options.element.value) {
				this.text = options.element.value;
			}else{
				this.text = options.element.innerHTML;
			}
			this.name = options.element.id;
			this.type = '[';
		} else if (options.url) {
			options.url = EJSpeed.endExt(options.url, this.extMatch);
			this.name = this.name ? this.name : options.url;
			var url = options.url
			var template = EJSpeed.get(this.name, this.cache);
			if (template) return template;
			if (template == EJSpeed.INVALID_PATH) return null;
			try {
				this.text = EJSpeed.request( url+(this.cache ? '' : '?'+Math.random() ));
			} catch(e){}

			if (this.text == null) {
				throw( {type: 'EJSpeed', message: 'There is no template at '+url}  );
			}
		}
		var template = new EJSpeed.Compiler(this.text, this.type);

		template.compile(options, this.name);
		
		EJSpeed.update(this.name, this);
		this.template = template;
	};
<commit_msg>Minor updates to fix pre-parsed element usage<commit_after>(function() {

  	var rsplit = function(string, regex) {
  		
		var result = regex.exec(string),
			retArr = [], 
			first_idx, 
			last_idx, 
			first_bit,
			rsplit_idx = 0;

		while (result != null) {
			first_idx = result.index; 
			last_idx = regex.lastIndex;
			if ((first_idx) != 0) {
				first_bit = string.substring(0,first_idx);
				retArr[rsplit_idx++] = string.substring(0,first_idx);
				string = string.slice(first_idx);
			}		
			retArr[rsplit_idx++] = result[0];
			string = string.slice(result[0].length);
			result = regex.exec(string);
				
		}

		if (! string == '') {
			retArr[rsplit_idx++] = string;
		}
		return retArr;
	}

	var chop =  function(string) {
		return string.substr(0, string.length - 1);
	}

	var extend = function(d, s) {
		for(var n in s) {
			if (s.hasOwnProperty(n))  d[n] = s[n];
		}
	}

	EJSpeed = function(options) {
		options = typeof options == "string" ? {view: options} : options
		this.set_options(options);
		if (options.precompiled) {
			this.template = {};
			this.template.process = options.precompiled;
			EJSpeed.update(this.name, this);
			return;
		}
		if (options.element) {
			if (typeof options.element == 'string') {
				var name = options.element
				options.element = document.getElementById(options.element);
				if (options.element == null) throw name+'does not exist!';
			}
			if (options.element.value) {
				this.text = options.element.value;
			} else {
				this.text = options.element.innerHTML;
			}
			this.name = options.element.id;
		} else if (options.url) {
			options.url = EJSpeed.endExt(options.url, this.extMatch);
			this.name = this.name ? this.name : options.url;
			var url = options.url
			var template = EJSpeed.get(this.name, this.cache);
			if (template) return template;
			if (template == EJSpeed.INVALID_PATH) return null;
			try {
				this.text = EJSpeed.request( url+(this.cache ? '' : '?'+Math.random() ));
			} catch(e){}

			if (this.text == null) {
				throw( {type: 'EJSpeed', message: 'There is no template at '+url}  );
			}
		}
		var template = new EJSpeed.Compiler(this.text, this.type);

		template.compile(options, this.name);
		
		EJSpeed.update(this.name, this);
		this.template = template;
	};

{'fraction_non_alphanumeric': 0.15539791620483262, 'fraction_numerical': 0.0035468853912657946, 'mean_word_length': 3.1470588235294117, 'pattern_counts': {'":': 0, '<': 3, '<?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': '699918', 'n_tokens_mistral': 1863, 'n_tokens_neox': 1583, 'n_words': 332}