<commit_before>(function( $ ){
	var multiSelectId=-1;
	$.fn.multiSelect=function(options){
		multiSelectId++;
		var settings = {
			'createCallback':false,
			'createText':false,
			'title':this.attr('title'),
			'checked':[],
			'oncheck':false,
			'onuncheck':false,
		};
		$.extend(settings,options);			
		var button=$('<div class="multiselect button"><span>'+settings.title+'</span><span>▾</span></div>');
		if(settings.checked.length>0){
			button.children('span').first().text(settings.checked.join(', '));
		}
		var span=$('<span/>');
		span.append(button);
		button.data('id',multiSelectId);
		button.selectedItems=[];
		this.hide();
		this.before(span);
		settings.minWidth=button.width();
		button.css('min-width',settings.minWidth);
		settings.minOuterWidth=button.outerWidth()-2;
		button.data('settings',settings);
		
		button.click(function(event){
			var button=$(this);
			if(button.parent().children('ul').length>0){
				button.parent().children('ul').slideUp(400,function(){
					button.parent().children('ul').remove();
					button.removeClass('active');
				});
				return;
			}
			var lists=$('ul.multiselectoptions');
			lists.slideUp(400,function(){
				lists.remove();
				$('div.multiselect').removeClass('active');
				button.addClass('active');
			});
			button.addClass('active');
			event.stopPropagation();
			var options=$(this).parent().next().children().map(function(){return $(this).val()});
			var list=$('<ul class="multiselectoptions"/>').hide().appendTo($(this).parent());
			function createItem(item,checked){
				var id='ms'+multiSelectId+'-option-'+item;
				var input=$('<input id="'+id+'" type="checkbox"/>');
				var label=$('<label for="'+id+'">'+item+'</label>');
				if(settings.checked.indexOf(item)!=-1 || checked){
					input.attr('checked','checked');
				}
				if(checked){
					settings.checked.push(item);
				}
				input.change(function(){
					var groupname=$(this).next().text();
					if($(this).attr('checked')){
						settings.checked.push(groupname);
						if(settings.oncheck){
							if(settings.oncheck(groupname)===false){
								$(this).removeAttr('checked');
								return;
							}
						}
					}else{
						var index=settings.checked.indexOf(groupname);
						settings.checked.splice(index,1);
						if(settings.onuncheck){
							if(settings.onuncheck(groupname)===false){
								$(this).attr('checked','checked');
								return;
							}
						}
					}
					var oldWidth=button.width();
					if(settings.checked.length>0){
						button.children('span').first().text(settings.checked.join(', '));
					}else{
						button.children('span').first().text(settings.title);
					}
					var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px'
					var newWidth=Math.max(button.width(),settings.minWidth);
					button.css('height',button.height());
					button.css('white-space','nowrap');
					button.css('width',oldWidth);<commit_msg>problem with previous selected groups fixed<commit_after>(function( $ ){
	var multiSelectId=-1;
	$.fn.multiSelect=function(options){
		multiSelectId++;
		var settings = {
			'createCallback':false,
			'createText':false,
			'title':this.attr('title'),
			'checked':[],
			'oncheck':false,
			'onuncheck':false,
		};
		$.extend(settings,options);			
		var button=$('<div class="multiselect button"><span>'+settings.title+'</span><span>▾</span></div>');
		if(settings.checked.length>0){
			button.children('span').first().text(settings.checked.join(', '));
		}
		var span=$('<span/>');
		span.append(button);
		button.data('id',multiSelectId);
		button.selectedItems=[];
		this.hide();
		this.before(span);
		settings.minWidth=button.width();
		button.css('min-width',settings.minWidth);
		settings.minOuterWidth=button.outerWidth()-2;
		button.data('settings',settings);
		
		button.click(function(event){
			var button=$(this);
			if(button.parent().children('ul').length>0){
				button.parent().children('ul').slideUp(400,function(){
					button.parent().children('ul').remove();
					button.removeClass('active');
				});
				return;
			}
			var lists=$('ul.multiselectoptions');
			lists.slideUp(400,function(){
				lists.remove();
				$('div.multiselect').removeClass('active');
				button.addClass('active');
			});
			button.addClass('active');
			event.stopPropagation();
			var options=$(this).parent().next().children().map(function(){return $(this).val();});
			var list=$('<ul class="multiselectoptions"/>').hide().appendTo($(this).parent());
			function createItem(item,checked){
				var id='ms'+multiSelectId+'-option-'+item;
				var input=$('<input id="'+id+'" type="checkbox"/>');
				var label=$('<label for="'+id+'">'+item+'</label>');
				if(settings.checked.indexOf(item)!=-1 || checked){
					input.attr('checked',true);
				}
				if(checked){
					settings.checked.push(item);
				}
				input.change(function(){
					var groupname=$(this).next().text();
					if($(this).is(':checked')){
						settings.checked.push(groupname);
						if(settings.oncheck){
							if(settings.oncheck(groupname)===false){
								$(this).attr('checked', false);
								return;
							}
						}
					}else{
						var index=settings.checked.indexOf(groupname);
						settings.checked.splice(index,1);
						if(settings.onuncheck){
							if(settings.onuncheck(groupname)===false){
								$(this).attr('checked',true);
								return;
							}
						}
					}
					var oldWidth=button.width();
					if(settings.checked.length>0){
						button.children('span').first().text(settings.checked.join(', '));
					}else{
						button.children('span').first().text(settings.title);
					}
					var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px';
					var newWidth=Math.max(button.width(),settings.minWidth);
					button.css('height',button.height());
					button.css('white-space','nowrap');
					button.css('width',oldWidth);
{'fraction_non_alphanumeric': 0.21450459652706844, 'fraction_numerical': 0.004766768811712632, 'mean_word_length': 4.034275921165381, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 31, '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': '6777123', 'n_tokens_mistral': 2387, 'n_tokens_neox': 1853, 'n_words': 203}