<commit_before>;(function($, window, document, undefined) {
	var idNumber = 0;
	$.fn.HUBfancyselect = function( method ) {
		if ( methods[method] ) 
		{
			return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} 
		else if ( typeof method === 'object' || ! method ) 
		{
			return methods.init.apply( this, arguments );
		} 
		else 
		{
			$.error( 'Method ' +  method + ' does not exist' );
		}
	};
	
	var methods = {},
		defaults = {
			hideSelect: true,
			showSearch: false,
			searchPlaceholder: 'Search...',
			maxHeightWithSearch: 500,
			onSearch: function() {},
			onSelected: function() {}
		};
	
	methods.init = function( options ) {
		var settings = $.extend({}, defaults, options);
		return this.each(function(){
			var $this = $(this),
				dropdown = '',
				children = $this.children();
			
			// must be a select element
			if (!$this.is('select'))
			{
				return 'Must be <select> element';
			}
			
			idNumber++;
			
			//set random #id
			$this.data('fancyselect', {
				id: idNumber,
				settings: settings
			});
			
			// create dropdown
			dropdown = $('<div class="fs-dropdown" id="fs-dropdown-' + $this.data('fancyselect').id + '"></div>')
				.append($('<ul></ul>')
					.append($('<li class="fs-dropdown-selected"></li>')
						.append($('<a href="" class="fs-dropdown-selected-item"><span>&nbsp;</span></a>'))
						.append($('<div class="fs-dropdown-options-container"></div>')
							.append(processChildren(children, 'fs-dropdown-options'))
						)
					)
				);
			
				//show search
			if (settings.showSearch) 
			{
				dropdown.find('.fs-dropdown-options-container')
					.prepend($('<div class="fs-dropdown-options-search"></div>')
						.append($('<input type="text" placeholder="' + settings.searchPlaceholder + '" />'))
					)
					.find('.fs-dropdown-options').css('max-height', settings.maxHeightWithSearch)
			}
			
			//append drop down
			$this.before( dropdown );
			
			//add event triggers
			addEventHooks( $this );
			
			//hide select box
			if(settings.hideSelect)
			{
				$this.hide();
			}
			
			// select selected option
			methods.selectValue.call($this, $this.find('option:selected').val(), false);
		});
	};
		
	methods.selectValue = function( value, callSelected ) {
		return this.each(function(){
			$('#fs-dropdown-' + $(this).data('fancyselect').id)
				.find('.fs-dropdown-option a[data-value=' + value + ']')
				.trigger('click', callSelected);
		});
	};
	
	methods.selectText = function( value, callSelected ) {
		return this.each(function(){
			$('#fs-dropdown-' + $(this).data('fancyselect').id)
				.find('.fs-dropdown-option a span:contains(' + value + ')')
				.parent('a')
				.trigger('click', callSelected);
		});
	};
	
	methods.clear = function() {
		return this.each(function(){
			$('#fs-dropdown-' + $(this).data('fancyselect').id)
				.find('.fs-dropdown-option a')
				.first()
				.trigger('click');
		});
	};
	
	methods.filterOptions = function( term ) {
		return this.each(function(){
			<commit_msg>[MEDIA] Updated fancy select library to support selecting value of empty string. something in jquery lib update caused script to break.<commit_after>;(function($, window, document, undefined) {
	var idNumber = 0;
	$.fn.HUBfancyselect = function( method ) {
		if ( methods[method] ) 
		{
			return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} 
		else if ( typeof method === 'object' || ! method ) 
		{
			return methods.init.apply( this, arguments );
		} 
		else 
		{
			$.error( 'Method ' +  method + ' does not exist' );
		}
	};
	
	var methods = {},
		defaults = {
			hideSelect: true,
			showSearch: false,
			searchPlaceholder: 'Search...',
			maxHeightWithSearch: 500,
			onSearch: function() {},
			onSelected: function() {}
		};
	
	methods.init = function( options ) {
		var settings = $.extend({}, defaults, options);
		return this.each(function(){
			var $this = $(this),
				dropdown = '',
				children = $this.children();
			
			// must be a select element
			if (!$this.is('select'))
			{
				return 'Must be <select> element';
			}
			
			idNumber++;
			
			//set random #id
			$this.data('fancyselect', {
				id: idNumber,
				settings: settings
			});
			
			// create dropdown
			dropdown = $('<div class="fs-dropdown" id="fs-dropdown-' + $this.data('fancyselect').id + '"></div>')
				.append($('<ul></ul>')
					.append($('<li class="fs-dropdown-selected"></li>')
						.append($('<a href="" class="fs-dropdown-selected-item"><span>&nbsp;</span></a>'))
						.append($('<div class="fs-dropdown-options-container"></div>')
							.append(processChildren(children, 'fs-dropdown-options'))
						)
					)
				);
			
				//show search
			if (settings.showSearch) 
			{
				dropdown.find('.fs-dropdown-options-container')
					.prepend($('<div class="fs-dropdown-options-search"></div>')
						.append($('<input type="text" placeholder="' + settings.searchPlaceholder + '" />'))
					)
					.find('.fs-dropdown-options').css('max-height', settings.maxHeightWithSearch)
			}
			
			//append drop down
			$this.before( dropdown );
			
			//add event triggers
			addEventHooks( $this );
			
			//hide select box
			if(settings.hideSelect)
			{
				$this.hide();
			}
			
			// select selected option
			methods.selectValue.call($this, $this.find('option:selected').val(), false);
		});
	};
		
	methods.selectValue = function( value, callSelected ) {
		return this.each(function(){
			$('#fs-dropdown-' + $(this).data('fancyselect').id)
				.find('.fs-dropdown-option a[data-value="' + value + '"]')
				.trigger('click', callSelected);
		});
	};
	
	methods.selectText = function( value, callSelected ) {
		return this.each(function(){
			$('#fs-dropdown-' + $(this).data('fancyselect').id)
				.find('.fs-dropdown-option a span:contains(' + value + ')')
				.parent('a')
				.trigger('click', callSelected);
		});
	};
	
	methods.clear = function() {
		return this.each(function(){
			$('#fs-dropdown-' + $(this).data('fancyselect').id)
				.find('.fs-dropdown-option a')
				.first()
				.trigger('click');
		});
	};
	
	methods.filterOptions = function( term ) {
		return this.each(function(){
			
{'fraction_non_alphanumeric': 0.19662008449788757, 'fraction_numerical': 0.0016249593760155996, 'mean_word_length': 3.036065573770492, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '7470951', 'n_tokens_mistral': 2433, 'n_tokens_neox': 1932, 'n_words': 384}