<commit_before>/*
 * http://github.com/deitch/jstree-grid
 *
 * This plugin handles adding a grid to a tree to display additional data
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Works only with jstree version >= 3.3.0
 *
 * $Date: 2015-11-29 $
 * $Revision:  3.4.2 $
 */

/*jslint nomen:true */
/*jshint unused:vars */
/*global console, navigator, document, jQuery, define, localStorage */

/* AMD support added by jochenberger per https://github.com/deitch/jstree-grid/pull/49
 *
 */
(function (factory) {
	if (typeof define === 'function' && define.amd) {
		// AMD. Register as an anonymous module.
		define(['jquery', 'jstree'], factory);
	} else {
		// Browser globals
		factory(jQuery);
	}
}(function ($) {
	var BLANKRE = /^\s*$/g,
		IDREGEX = /[\\:&!^|()\[\]<>@*'+~#";,= \/${}%]/g, escapeId = function (id) {
			return (id||"").replace(IDREGEX,'\\$&');
		}, NODE_DATA_ATTR = "data-jstreegrid", COL_DATA_ATTR = "data-jstreegrid-column",
		SEARCHCLASS = "jstree-search",
	SPECIAL_TITLE = "_DATA_", LEVELINDENT = 24, styled = false, GRIDCELLID_PREFIX = "jsgrid_",GRIDCELLID_POSTFIX = "_col",
		MINCOLWIDTH = 10,
		findDataCell = function (from,ids) {
			var ret;
			if (ids === null || ids === undefined) {
				ret = $();
			} else if (typeof(ids) === "string") {
				ret = from.find("div["+NODE_DATA_ATTR+"='"+ids+"']");
			} else if (ids.length === 0) {
				ret = from.find("div["+NODE_DATA_ATTR+"='"+ids.id+"']");
			} else {
				ret = ids.map(function (i,id) {
					return from.find("div["+NODE_DATA_ATTR+"='"+id.id+"']");
				});
			}
			return ret;
		},
		isClickedSep = false, toResize = null, oldMouseX = 0, newMouseX = 0,

	/*jslint regexp:true */
	htmlstripre = /<\/?[^>]+>/gi,
	/*jslint regexp:false */

	getIndent = function(node,tree) {
		var div, i, li, width;

		// did we already save it for this tree?
		tree._gridSettings = tree._gridSettings || {};
		if (tree._gridSettings.indent > 0) {<commit_msg>Remove repetitive search loop in favour of intelligent filter<commit_after>/*
 * http://github.com/deitch/jstree-grid
 *
 * This plugin handles adding a grid to a tree to display additional data
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Works only with jstree version >= 3.3.0
 *
 * $Date: 2015-11-29 $
 * $Revision:  3.4.2 $
 */

/*jslint nomen:true */
/*jshint unused:vars */
/*global console, navigator, document, jQuery, define, localStorage */

/* AMD support added by jochenberger per https://github.com/deitch/jstree-grid/pull/49
 *
 */
(function (factory) {
	if (typeof define === 'function' && define.amd) {
		// AMD. Register as an anonymous module.
		define(['jquery', 'jstree'], factory);
	} else {
		// Browser globals
		factory(jQuery);
	}
}(function ($) {
	var BLANKRE = /^\s*$/g,
		IDREGEX = /[\\:&!^|()\[\]<>@*'+~#";,= \/${}%]/g, escapeId = function (id) {
			return (id||"").replace(IDREGEX,'\\$&');
		}, NODE_DATA_ATTR = "data-jstreegrid", COL_DATA_ATTR = "data-jstreegrid-column",
		SEARCHCLASS = "jstree-search",
	SPECIAL_TITLE = "_DATA_", LEVELINDENT = 24, styled = false, GRIDCELLID_PREFIX = "jsgrid_",GRIDCELLID_POSTFIX = "_col",
		MINCOLWIDTH = 10,
		findDataCell = function (from,ids) {
			var ret;
			if (ids === null || ids === undefined) {
				ret = $();
			} else if (typeof(ids) === "string") {
				ret = from.find("div["+NODE_DATA_ATTR+"='"+ids+"']");
			} else if (ids.length === 0) {
				ret = from.find("div["+NODE_DATA_ATTR+"='"+ids.id+"']");
			} else {
				// created a hashtable of the valid IDs
				var idhash = $.makeArray(ids).reduce(function (total, elm) {
					total[elm.id] = true;
					return total;
				}, {});
				ret = from.find("div").filter(function (index, elm) {
					return idhash[$(elm).attr(NODE_DATA_ATTR)];
				});
			}
			return ret;
		},
		isClickedSep = false, toResize = null, oldMouseX = 0, newMouseX = 0,

	/*jslint regexp:true */
	htmlstripre = /<\/?[^>]+>/gi,
	/*jslint regexp:false */

	getIndent = function(node,tree) {
		var div, i, li, width;

		// did we already save it for this tree?
		tree._gridSettings = tree._gridSettings || {};
		if (tree._gridSettings.indent > 0) {
{'fraction_non_alphanumeric': 0.1978468899521531, 'fraction_numerical': 0.011483253588516746, 'mean_word_length': 3.4526091586794463, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '292138', 'n_tokens_mistral': 1700, 'n_tokens_neox': 1526, 'n_words': 349}