<commit_before>(function($){
	/**
	 * jQuery plugin for multiselect_search
	 *
	 * @param options {selectAllLinks: false,showSelectedLink: false,showSelectedList: false}
	 * @param mss_config - config passed on to multiselect_search
	 */
	$.fn.mss = function(options, mss_config) {
		var settings = {
				selectAllLinks: false,
				showSelectedLink: false,
				showSelectedList: false
			};
		$.extend(settings, options);

		this.each(function() {

			var mss = multiselect_search(this, mss_config);
			if (!mss) {
				return;
			}

			if (!settings.selectAllLinks && !settings.showSelectedLink && !settings.showSelectedList) {
				return;
			}

			var $footer = $('<span/>').addClass('mss_footer').appendTo(mss.container_node);

			if (settings.selectAllLinks) {
				$('<a/>')
					.html('select all')
					.attr('href', '#')
					.click(function(){
						mss.changeState(true, true);
						return false;
					})
					.appendTo($footer);

				$('<span/>').html(' | ').appendTo($footer);

				$('<a/>')
					.html('select none')
					.attr('href', '#')
					.click(function(){
						mss.changeState(false, true);
						return false;
					})
					.appendTo($footer);

				if (settings.showSelectedLink) {
					$('<span/>').html(' | ').appendTo($footer);
				}
			}
			if (settings.showSelectedLink) {
				$('<a/>')
					.html('show selected')
					.attr('href', '#')
					.click(function(){
						mss.showSelected();
						return false;
					})
					.appendTo($footer);
			}
			if (settings.showSelectedList) {
				var $list = $('<div/>').appendTo($footer);
				function showSelectedList() {
					$list.html('');

					var vals = mss.get_selected(),
						i;
					if (!vals.length) {
						return;
					}
					$list.append('Selected Items:');

					$.each(vals, function(i) {
						var opt = this;
						$list.append(' ' + this.text + ' (');
						$list.append(
							$('<a/>')
								.html('x')
								.attr('href', '#')
								.click(function(){
									opt.changeState(false);
									return false;
							})
						);
						$list.append(')' + (i + 1 < vals.length ? ',' : ''));
					});
				}
				showSelectedList();
				mss.onchange(showSelectedList);
			}
		});
	};
})(jQuery);<commit_msg>code styling<commit_after>(function($){
	/**
	 * jQuery plugin for multiselect_search
	 *
	 * @param options {selectAllLinks: false,showSelectedLink: false,showSelectedList: false}
	 * @param mss_config - config passed on to multiselect_search
	 */
	$.fn.mss = function(options, mss_config) {
		var settings = {
				selectAllLinks: false,
				showSelectedLink: false,
				showSelectedList: false
			};
		$.extend(settings, options);

		this.each(function() {

			var mss = multiselect_search(this, mss_config);
			if (!mss) {
				return;
			}

			if (!settings.selectAllLinks && !settings.showSelectedLink && !settings.showSelectedList) {
				return;
			}

			var $footer = $('<span/>').addClass('mss_footer').appendTo(mss.container_node);

			if (settings.selectAllLinks) {
				$('<a/>')
					.html('select all')
					.attr('href', '#')
					.click(function(){
						mss.changeState(true, true);
						return false;
					})
					.appendTo($footer);

				$('<span/>').html(' | ').appendTo($footer);

				$('<a/>')
					.html('select none')
					.attr('href', '#')
					.click(function(){
						mss.changeState(false, true);
						return false;
					})
					.appendTo($footer);

				if (settings.showSelectedLink) {
					$('<span/>').html(' | ').appendTo($footer);
				}
			}
			if (settings.showSelectedLink) {
				$('<a/>')
					.html('show selected')
					.attr('href', '#')
					.click(function(){
						mss.showSelected();
						return false;
					})
					.appendTo($footer);
			}
			if (settings.showSelectedList) {
				var $list = $('<div/>').appendTo($footer),
                    showSelectedList = function() {
					$list.html('');

					var vals = mss.get_selected();
					if (!vals.length) {
						return;
					}
					$list.append('Selected Items:');

					$.each(vals, function(i) {
						var opt = this;
						$list.append(' ' + this.text + ' (');
						$list.append(
							$('<a/>')
								.html('x')
								.attr('href', '#')
								.click(function(){
									opt.changeState(false);
									return false;
							})
						);
						$list.append(')' + (i + 1 < vals.length ? ',' : ''));
					});
				};
				showSelectedList();
				mss.onchange(showSelectedList);
			}
		});
	};
})(jQuery);
{'fraction_non_alphanumeric': 0.19400953029271614, 'fraction_numerical': 0.0004538234626730202, 'mean_word_length': 2.4654088050314464, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '2924501', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1440, 'n_words': 249}