<commit_before>angular
	.module('ngSharepoint.Mocks')
	.factory('SPList', ['lists', function(lists) {
		var SPList = function(title) {
			this.title = title;
			this.list = lists[title]; //{cols: [], data:[[]]}
		};
		SPList.prototype.insert = function(data) {
			return $q(function(resolve, reject) {
				this.list.data.push(data);
				resolve();
			});
		};
		SPList.prototype.select = function(query) {
			var list = this;
			return $q(function(resolve, reject) {
				var data = [];
				var parser = new DOMParser();
				camlQuery = parser.parseFromString(query, 'text/xml');
				var queryTag = camlQuery.getElementsByTagName('Query')[0];
				if (queryTag !== null) {
					var equalTags = queryTag.getElementsByTagName('Eq');
					if (equalTags !== null) {
						var eqs = [];
						equalTags.forEach(function(tag) {
							var field = tag.getElementsByTagName('FieldRef')[0].attributes.Name.value;
							var fieldId = list.list.cols.indexOf(field);
							var value = tag.getElementsByTagName('Value')[0].childNodes[0];
							eqs.push({id: fieldId, value: value});<commit_msg>Align data to the internal table structure<commit_after>angular
	.module('ngSharepoint.Mocks')
	.factory('SPList', ['lists', function(lists) {
		var SPList = function(title) {
			this.title = title;
			this.list = lists[title]; //{cols: [], data:[[]]}
		};
		SPList.prototype.insert = function(data) {
			var list = this;
			return $q(function(resolve, reject) {
				var alignedData = [];
				for (var i = 0; i < list.list.cols.length; i++) {
					alignedData[i] = data[list.list.cols[i]];
				}
				this.list.data.push(alignedData);
				resolve();
			});
		};
		SPList.prototype.select = function(query) {
			var list = this;
			return $q(function(resolve, reject) {
				var data = [];
				var parser = new DOMParser();
				camlQuery = parser.parseFromString(query, 'text/xml');
				var queryTag = camlQuery.getElementsByTagName('Query')[0];
				if (queryTag !== null) {
					var equalTags = queryTag.getElementsByTagName('Eq');
					if (equalTags !== null) {
						var eqs = [];
						equalTags.forEach(function(tag) {
							var field = tag.getElementsByTagName('FieldRef')[0].attributes.Name.value;
							var fieldId = list.list.cols.indexOf(field);
							var value = tag.getElementsByTagName('Value')[0].childNodes[0];
							eqs.push({id: fieldId, value: value});
{'fraction_non_alphanumeric': 0.167020824479388, 'fraction_numerical': 0.003824904377390565, 'mean_word_length': 3.5095785440613025, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '249955', 'n_tokens_mistral': 952, 'n_tokens_neox': 766, 'n_words': 151}