<commit_before>(function(){

	//解决jQuery关键字与$关键字类库之间冲突
	var _jQuery = window.jQuery,
		_$ = window.$;
	//暴露jQuery接口
	//通过init方法，创建实例对象
	//声明jQuery变量，根据变量查找原则，在插件内使用jQuery变量提高性能
	//selector选择器
	//context，选择器的查找范围，默认为HTMLDocument
	var jQuery = window.jQuery = window.$ = function( selector, context ){
		return new jQuery.fn.init( selector, context );
	};

	//匹配html DOM节点形式
	//?
	var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,

	//匹配class id 子代选择器
	//?
		isSimple = /^.[^:#\[\.]*$/,
		//根据变量查找原则，加快判断速度
		undefined;
	//定义jQuery构造函数的prototype，实例化共性方法
	//将原型对象通过jQuery.fn的形式暴露出去
	//jQuery.fn.abc()
	jQuery.fn = jQuery.prototype = {
		// 构造函数
		init: function( selector, context ){
			//选择器初始化，没有传入选择器时默认为document
			selector = selector || document;

			//匹配选择器是DOM对象情况
			//DOM对象转jQuery对象
			//在页面初始加载完成时jQuery对象中即是document（2413行进行了对象创建）
			if( selector.nodeType ){
				//构造的对象为数组型对象
				//将第一个元素置为DOM对象
				this[0] = selector;
				//修改对象长度属性
				this.length = 1;
				return this;
			}

			//匹配选择器是字符串情况
			if( typeof selector == "string" ){
				//?
				var match = quickExpr.exec( selector );
				//?
				if( match && (match[1] || !context) ){
					//转化html片段至dom对象
					if( match[1] )
						//？
						selector = jQuery.clean( [ match[1] ], context );
					//处理id选择器情况
					else{
						//通过id获取元素
						var elem = document.getElementById( match[3] );

						//确定元素为当前document中的元素
						if( elem ){
							//处理ie浏览器与欧朋浏览器中获取元素的异常
							if( elem.id != match[3] )
								//调用jQuery实例的find方法进行查找元素
								return jQuery().find( selector );

							//将dom元素转化为jQuery元素
							return jQuery( elem );
						}
						selector = [];
					}

				} else
					return jQuery( context ).find( selector );

			//匹配selector为function情况
			} else if ( jQuery.isFunction( selector ) )
				return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );

			return this.setArray(jQuery.makeArray(selector));
		},

		//当前版本
		jquery: "1.2.6",

		//获取对象数组长度
		size: function(){
			return this.length;
		},

		length: 0,

		//获取对象数组中的元素
		get: function( num ){
			//如果num为undefined，则重新构建数组对象，并将对象数组返回
			return num == undefined ?
				jQuery.makeArray( this ) :
				this[num];
		},

		find: function( selector ){
			var elems = jQuery.map(this, function(elem){
				return jQuery.find( selector, elem );
			});

			return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ?
				jQuery.unique( elems ) :
				elems );
		},

		map: function( callback ){
			return this.pushStack( jQuery.map(this, function(elem, i){
				return callback.call( elem, i, elem )
			}));
		},

		//修改jQuery对象中的prevObject对象，将当前调用对象修改为prevObject，保存调用历史
		pushStack: function( elems ){
			var ret = jQuery( elems );
			ret.prevObject = this;
			return ret;
		},

		//将elems推入当前对象数组中
		setArray: function( elems ){
			this.length = 0;
			Array.prototype.push.apply( this, elems );

			return this;
		},

		each: function( callback, args ){
			return jQuery.each( this, callback, args );
		},
		//返回元素所在下标
		index: function( elem ){
			var ret = -1;

			//判断非空并取出dom元素
			return jQuery.inArray(
				elem && elem.jquery ? elem[0] : elem
			, this );
		},
		//获取元素样式
		css: function( key, value ){
			//处理设置高度与宽度时value为负数的情况
			if( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
				value = undefined;
			//调用curCSS方法操作样式属性
			return this.attr( key, value, "curCSS" );
		},
		attr: function( name, value, type ){
			var options = name;
			//如果value为空，则通过'type'或attr方法获取属性值
			//设置值通过jQuery的attr接口统一处理(curCSS)
			if( name.constructor == String )
				if( value === undefined )
					return this[0] && jQuery[ type || "attr"]( this[0], name );
				else{
					options = {};
					options[ name ] = value;
				}

				return this.each(function(i){
					for( name in options )
						jQuery.attr(
							type ?
								this.style :
								this,
							name, jQuery.prop( this, options[ name ], type, i, name )
						);
				});
		},
		//操作获取实例文本
		text: function( text ){
			//设置元素文本值
			//先清空元素内容再将文本节点添加上去
			if( typeof text != "object" && text != null )
				return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );

			var ret = "";

			jQuery.each( text || this, function(){
				jQuery.each( this.childNodes, function(){
					//排除注释节点
					if( this.nodeType != 8 )
						//如果是元素节点返回nodeValue
						ret += this.nodeType != 1 ?
							this.nodeValue :
							jQuery.fn.text( [text] );
				});
			});

			return ret;
		},
		//将选择器选择的所有元素用指定的html片段包裹
		warpAll: function( html ){
			if( this[0] ){
				jQuery( html, this[0].ownerDocument )
					.clone()
					.insertBefore( this[0] )
					.map(function(){
						var elem = this;

						while( elem.firstChild )
							elem = elem.firstChild;

						return elem;
					})
					.append(this);
			}

			return this;
		},
		//将选择器选择的所有元素的内部元素用指定元素包裹
		warpInner: function( html ){
			return this.each(function(){
				jQuery(this).contents().warpAll( html );
			});
		},
		//追加元素
		append: function(){
			return this.domManip(arguments, true, false, function(elem){
				if( this.nodeType == 1 )
					this.appendChild( elem );
			});
			}
		},
		//排除指定元素
		not: function( selector ){
			if( selector.constructor == String )
				if ( isSimple.test( selector ) )
					return this.pushStack( jQuery.multiFilter( selector, this, true ) );
				else
					selector = jQuery.multiFilter( selector, this );

			var isArrayLike = selector.length && selector[selector.length-1] !== undefined && !selector.nodeType
			return this.filter(function(){
				return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
			}); 
		}，
		//?
		domManip: function( args, table, reverse, callback ){
			var clone = this.length > 1, elems;

			return this.each(function(){
				if ( !elems ) {
					elems = jQuery.clean( args, this.ownerDocument );

					if ( reverse )
						elems.reverse();
				}

				var obj = this;

				//处理table情况，如果是table则需要加入tbody
				if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
					obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );

				var scripts = jQuery( [] );

				jQuery.each(elems, function(){
					var elem = clone ?
						jQuery( this ).clone( true )[0] :
						this;

					// 处理script脚本，如果脚本可以执行，则进行执行
					if ( jQuery.nodeName( elem, "script" ) )
						scripts = scripts.add( elem );
					else {
						//移除所有的script脚本
						if ( elem.nodeType == 1 )
							scripts = scripts.add( jQuery( "script", elem ).remove() );

						//添加元素至当前对象
						callback.call( obj, elem );
					}
				});

				scripts.each( evalScript );
			});
		}

	};

	//将通过init构造函数实例化对象的原型指向jQuery.prototype
	jQuery.fn.init.prototype = jQuery.fn;

	function evalScript( i, elem ){
		//加载javascript脚本
		if( elem.src )
			jQuery.ajax({
				url: elem.src,
				async: false,
				dataType: "script"
			});
		//执行javascript脚本
		else
			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" )
		
		if ( elem.parentNode )
			elem.parentNode.removeChild( elem );
	}

	function now(){
		return +new Date;
	}
	//jQuery函数扩展
	//静态方法扩展，实例方法扩展
	jQuery.extend = jQuery.fn.extend = function(){

	};

	var expando = "jQuery" + now(), uuid = 0, windowData = {},
		// exclude the following css properties to add px
		exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
		// 存储document 对象所关联的 window 对象
		defaultView = document.defaultView || {};

	//扩展方法
	jQuery.extend({
		//解决类库之间关键字冲突
		noConflict: function(){
			window.$ = _$;

			//jQuery关键字也冲突的情况
			if( deep )
				window.jQuery = _jQuery;
			
			return jQuery;
		},
		//加载执行javascript脚本
		globalEval: function( data ){
			data = jQuery.trim( data );

			if( data ){
				//添加脚本片段至head便签内
				//执行完毕后删除
				var head = document.getElementsByTagName("head")[0] || document.documentElement,
					script = document.createElement("script");

				script.type = "text/javascript";
				if ( jQuery.browser.msie )
					script.text = data;
				else
					script.appendChild( document.createTextNode( data ) );
				//使用insertBefore来避免IE6bug
				head.insertBefore( script, head.firstChild );
				head.removeChild( script );
			}
		},
		//?
		clean: function( elems, context ){
			//?
			var ret = [];
			//作用域范围，默认为HTMLDocument
			context = context || document;
			//在后续会通过createElement创建元素，在IE中document.createElement为'object'，不是'function'
			//通过ownerDocument方式获取document
			if( typeof context.createElement == 'undefined' )
				context = context.ownerDocument || context[0] && context[0].ownerDocument || document;

			jQuery.each(elems, function(i, elem){
				//判断null，undefined与""情况
				if( !elem )
					return;

				//判断数字情况
				if( elem.constructor == Number )
					//转换成字符串
					elem += '';

				if( typeof elem == 'string' ){
					//将单标签转化为双标签
					elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
						return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
							all :
							front + "></" + tag + ">";
					//去除标签中的空白
					var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement('div');

					//?
					var wrap = 
						!tags.indexOf("<opt") &&
						[ 1, "<select multiple='multiple'>", "</select>" ] ||

						!tags.indexOf("<leg") &&
						[ 1, "<fieldset>", "</fieldset>" ] ||

						tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
						[ 1, "<table>", "</table>" ] ||

						!tags.indexOf("<tr") &&
						[ 2, "<table><tbody>", "</tbody></table>" ] ||

					 	// <thead> matched above
						(!tags.indexOf("<td") || !tags.indexOf("<th")) &&
						[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||

						!tags.indexOf("<col") &&
						[ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||

						// IE can't serialize <link> and <script> tags normally
						jQuery.browser.msie &&
						[ 1, "div<div>", "</div>" ] ||

						[ 0, "", "" ];

					//标签包裹
					div.innerHTML = wrap[1] + elem + wrap[2];

					//?
					while( wrap[0]-- )
						div = div.lastChild;

					});

					//?
					if ( jQuery.browser.msie ) {

						// String was a <table>, *may* have spurious <tbody>
						var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
							div.firstChild && div.firstChild.childNodes :

							// String was a bare <thead> or <tfoot>
							wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
								div.childNodes :
								[];

						for ( var j = tbody.length - 1; j >= 0 ; --j )
							if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
								tbody[ j ].parentNode.removeChild( tbody[ j ] );

						// IE completely kills leading whitespace when innerHTML is used
						if ( /^\s/.test( elem ) )
							div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );

					}

					elem = jQuery.makeArray( div.childNodes );
				}

				//没有选择到的元素，并且不是form也不是select
				if( elem.length === 0 && (!jQuery.nodeName( elem, 'form' ) && (!jQuery.nodeName( elem, 'select' ))) )
					return;
				//?
				if( elem[0] == undefined || jQuery.nodeName( elem, 'form' ) || elem.options )
					ret.push( elem );
				else
					ret = jQuery.merage( ret, elem );
			});

			return ret;
		},
		//去除字符串开头与结尾的空格
		trim: function( text ){
			return (text || "").replace( /^\s+|\s+$/g, "" );
		},
		//对象数组
		makeArray: function( array ){
			var ret = [];
			if( array != null ){
				var i =  array.length;
				//确定array为数组对象
				if( i == null || array.split || array.setInterval || array.call )
					ret[0] = array;
				else
					while( i )
						ret[--i] = array[i];
			}

			return ret;
		},
		//判断元素名是否为name
		nodeName: function( elem, name ){
			return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
		},
		cache: {},
		//为指定元素添加key value数据
		//https://api.jquery.com/jquery.data/
		data: function( elem, name, data ){
			//判断对象是否为window
			elem = elem == window ?
				windowData :
				elem;
			var id = elem[ expando ];

			if( !id )
				id = elem[ expando ] = ++uuid;

			if( name && !jQuery.cache[ id ] )
				jQuery.cache[ id ] = {};

			if( data != undefined )
				jQuery.cache[ id ][ name ] = data;

			return name ?
				jQuery.cache[ id ][ name ] : 
				id;
		}
		//判断元素是否为function
		isFunction: function( fn ) {
			return !!fn && typeof fn != "string" && !fn.nodeName &&
				fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
		},
		//判断元素是否为XML document
		isXMLDoc: function( elem ) {
			return elem.documentElement && !elem.body ||
				elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
		},
		//args参数只在内部使用
		each: function( object, callback, args ){
			var name, i = 0, length = object.length;

			if( args ){
				if( length == undefined ){
					for( name in object )
						if( callback.apply( object[name], args ) === false)
							break;
				}else
					for( ; i<length; )
						if( callback.apply( object[ i++ ], args ) === false )
							break;
			}else{
				if ( length == undefined ) {
				for ( name in object )
					if ( callback.call( object[ name ], name, object[ name ] ) === false )
						break;
				} else
					for ( var value = object[0];
						i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
			}
			return object;
		},
		//获取元素样式属性值
		curCSS: function( elem, name, force ){
			//初始化元素的style属性
			var ret, style = elem.style;

			//判断元素样式是否失效
			function color( elem ){
				if( !jQuery.browser.safari )
					return false;

				var ret = defaultView.getComputedStyle( elem, null );
				return !ret || ret.getPropertyValue("color") == "";
			}

			// We need to handle opacity special in IE
			if ( name == "opacity" && jQuery.browser.msie ) {
				ret = jQuery.attr( style, "opacity" );

				return ret == "" ?
					"1" :
					ret;
			}

			// Opera sometimes will give the wrong display answer, this fixes it, see #2037
			if ( jQuery.browser.opera && name == "display" ) {
				var save = style.outline;
				style.outline = "0 solid black";
				style.outline = save;
			}

			// Make sure we're using the right name for getting the float value
			if ( name.match( /float/i ) )
				name = styleFloat;

			if ( !force && style && style[ name ] )
				ret = style[ name ];

			else if( defaultView.getComputedStyle ){

				//处理"float"情况
				if( name.match( /float/i ) )
					name = "float";

				name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();

				//获取元素所有样式
				var computedStyle = defaultView.getComputedStyle( elem, null );
				//获取指定样式
				if( computedStyle && !color( elem ) )
					ret = computedStyle.getPropertyValue( name );
				//处理无法获取元素样式的情况
				else {
					var swap = [], stack = [], a = elem, i = 0;

					//将当前节点的所有父节点压入栈中
					for( ; a && color(a); a = a.parentNode )
						stack.unshift(a)

					//将栈中的元素全部置为可视状态
					for( ; i < stack.length; i++ )
						if( color( stack[ i ] ) ){
							swap[ i ] = stack[ i ].style.display;
							stack[ i ].style.display = "block";
						}

					//处理指定样式为display的情况
					ret = name == "display" && swap[ stack.length - 1 ] != null ?
						"none" :
						( computedStyle && computedStyle.getPropertyValue( name ) ) || "";

					//恢复display属性
					for( i = 0; i < swap.length; i++ )
						if( swap[ i ] != null )
							stack[i].style.display = swap[i];
				}

				// We should always get a number back from opacity
				if ( name == "opacity" && ret == "" )
					ret = "1";
			//IE情况
			} else if( elem.currentStyle ){
				var camelCase = name.replace(/\-(\w)/g, function(all, letter){
					return letter.toUpperCase();
				});

				ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];

				// From the awesome hack by <NAME>
				// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291

				// If we're not dealing with a regular pixel number
				// but a number that has a weird ending, we need to convert it to pixels
				if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
					// Remember the original values
					var left = style.left, rsLeft = elem.runtimeStyle.left;

					// Put in the new values to get a computed value out
					elem.runtimeStyle.left = elem.currentStyle.left;
					style.left = ret || 0;
					ret = style.pixelLeft + "px";

					// Revert the changed values
					style.left = left;
					elem.runtimeStyle.left = rsLeft;
				}
			}
			return ret;
		},
		//操作元素属性
		attr: function( elem, name, value ){
			//排除在文本节点，注释节点上设置属性
			if( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
				return undefined;

			var notxml = !jQuery.isXMLDoc( elem ),
				set = value !== undefined,
				msie = jQuery.browser.msie;

			//在非xml文档类型下修正一些属性名
			name = notxml && jQuery.props[ name ] || name;

			if( elem.tagName ){
				//特殊的属性
				var special = /href|src|style/.test(name);
				// Safari mis-reports the default selected property of a hidden option
				// Accessing the parent's selectedIndex property fixes it
				if ( name == "selected" && jQuery.browser.safari )
					elem.parentNode.selectedIndex;

				if( name in elem && notxml && !special ){
					if( set ){
						//不能修改input的type属性
						if( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
							throw "type property can't be changed";

						elem[ name ] = value;
					}
					if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
						return elem.getAttributeNode( name ).nodeValue;

					return elem[name];
				}

				//此处有问题，后续jQuery版本中进行了更正
				if( msie && notxml && name == "style" )
					return jQuery.attr( elem.style, "cssText", value );
				
				if( set )
					elem.setAttribute( name, "" + value );

				var attr = msie && notxml && special
						? elem.getAttribute( name, 2 )
						: elem.getAttribute( name );

				return attr === null ? undefined : attr;
			}

			// IE uses filters for opacity
			if ( msie && name == "opacity" ) {
				if ( set ) {
					// IE has trouble with opacity if it does not have layout
					// Force it by setting the zoom level
					elem.zoom = 1;

					// Set the alpha filter to set the opacity
					elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
						(parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
				}

				return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
					"";
			}

			name = name.replace(/-([a-z])/ig, function(all, letter){
				return letter.toUpperCase();
			});

			if ( set )
				elem[ name ] = value;

			return elem[ name ];
		},
		//判断元素是否在数组中，并返回所在位置下标
		inArray: function( elem, array ){
			for( var i = 0, length = array.length; i < length; i++ )
				if( array[ i ] === elem )
					return i;
			return -1;
		},
		//将第二个参数中的元素合并至第一个参数中
		merage: function( first, second ){
			var i = 0, elem, pos = first.length;

			//兼容ie
			if( jQuery.browser.msie ){
				while( elem = second[ i++ ] )
					if( elem.nodeType !=8 )
						first[ pos++ ] = elem;
			}else
				while ( elem = second[ i++ ] )
					first[ pos++ ] = elem;

			return first;
		},
		//！进行数组去重，此方法在此版本有一些问题
		unique: function( array ){
			var ret = [], done = {};

			try{
				for( var i = 0, length = array.length; i<length; i++ ){
					//调用data方法返回一个唯一的id
					var id = jQuery.data( array[ i ] );

					if( !done[ id ] ){
						done[ id ] = true;
						ret.push( array[ i ] );
					}
				}
			} catch( e ){
				ret = array;
			}
			return ret;
		},
		//对指定元素作为callback参数进行处理
		//callback参数1.dom元素 2.index
		map:function( elems, callback ){
			var ret = [];
			for( var i = 0, length = elems.length; i < length; i++ ){
				var value = callback( elems[ i ], i );

				if( value != null )
					ret[ ret.length ] = value
			}

			return ret.concat.apply( [], ret );
		}
	});<commit_msg>What: 完成filter方法 完成add方法 完成is方法 完成hasClass方法 完成val方法 完成grep方法 Why: How:<commit_after>(function(){

	//解决jQuery关键字与$关键字类库之间冲突
	var _jQuery = window.jQuery,
		_$ = window.$;
	//暴露jQuery接口
	//通过init方法，创建实例对象
	//声明jQuery变量，根据变量查找原则，在插件内使用jQuery变量提高性能
	//selector选择器
	//context，选择器的查找范围，默认为HTMLDocument
	var jQuery = window.jQuery = window.$ = function( selector, context ){
		return new jQuery.fn.init( selector, context );
	};

	//匹配html DOM节点形式
	//?
	var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,

	//匹配class id 子代选择器
	//?
		isSimple = /^.[^:#\[\.]*$/,
		//根据变量查找原则，加快判断速度
		undefined;
	//定义jQuery构造函数的prototype，实例化共性方法
	//将原型对象通过jQuery.fn的形式暴露出去
	//jQuery.fn.abc()
	jQuery.fn = jQuery.prototype = {
		// 构造函数
		init: function( selector, context ){
			//选择器初始化，没有传入选择器时默认为document
			selector = selector || document;

			//匹配选择器是DOM对象情况
			//DOM对象转jQuery对象
			//在页面初始加载完成时jQuery对象中即是document（2413行进行了对象创建）
			if( selector.nodeType ){
				//构造的对象为数组型对象
				//将第一个元素置为DOM对象
				this[0] = selector;
				//修改对象长度属性
				this.length = 1;
				return this;
			}

			//匹配选择器是字符串情况
			if( typeof selector == "string" ){
				//?
				var match = quickExpr.exec( selector );
				//?
				if( match && (match[1] || !context) ){
					//转化html片段至dom对象
					if( match[1] )
						//？
						selector = jQuery.clean( [ match[1] ], context );
					//处理id选择器情况
					else{
						//通过id获取元素
						var elem = document.getElementById( match[3] );

						//确定元素为当前document中的元素
						if( elem ){
							//处理ie浏览器与欧朋浏览器中获取元素的异常
							if( elem.id != match[3] )
								//调用jQuery实例的find方法进行查找元素
								return jQuery().find( selector );

							//将dom元素转化为jQuery元素
							return jQuery( elem );
						}
						selector = [];
					}

				} else
					return jQuery( context ).find( selector );

			//匹配selector为function情况
			} else if ( jQuery.isFunction( selector ) )
				return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );

			return this.setArray(jQuery.makeArray(selector));
		},

		//当前版本
		jquery: "1.2.6",

		//获取对象数组长度
		size: function(){
			return this.length;
		},

		length: 0,

		//获取对象数组中的元素
		get: function( num ){
			//如果num为undefined，则重新构建数组对象，并将对象数组返回
			return num == undefined ?
				jQuery.makeArray( this ) :
				this[num];
		},

		find: function( selector ){
			var elems = jQuery.map(this, function(elem){
				return jQuery.find( selector, elem );
			});

			return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ?
				jQuery.unique( elems ) :
				elems );
		},

		map: function( callback ){
			return this.pushStack( jQuery.map(this, function(elem, i){
				return callback.call( elem, i, elem )
			}));
		},

		//修改jQuery对象中的prevObject对象，将当前调用对象修改为prevObject，保存调用历史
		pushStack: function( elems ){
			var ret = jQuery( elems );
			ret.prevObject = this;
			return ret;
		},

		//将elems推入当前对象数组中
		setArray: function( elems ){
			this.length = 0;
			Array.prototype.push.apply( this, elems );

			return this;
		},

		each: function( callback, args ){
			return jQuery.each( this, callback, args );
		},
		//返回元素所在下标
		index: function( elem ){
			var ret = -1;

			//判断非空并取出dom元素
			return jQuery.inArray(
				elem && elem.jquery ? elem[0] : elem
			, this );
		},
		//获取元素样式
		css: function( key, value ){
			//处理设置高度与宽度时value为负数的情况
			if( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
				value = undefined;
			//调用curCSS方法操作样式属性
			return this.attr( key, value, "curCSS" );
		},
		attr: function( name, value, type ){
			var options = name;
			//如果value为空，则通过'type'或attr方法获取属性值
			//设置值通过jQuery的attr接口统一处理(curCSS)
			if( name.constructor == String )
				if( value === undefined )
					return this[0] && jQuery[ type || "attr"]( this[0], name );
				else{
					options = {};
					options[ name ] = value;
				}

				return this.each(function(i){
					for( name in options )
						jQuery.attr(
							type ?
								this.style :
								this,
							name, jQuery.prop( this, options[ name ], type, i, name )
						);
				});
		},
		//操作获取实例文本
		text: function( text ){
			//设置元素文本值
			//先清空元素内容再将文本节点添加上去
			if( typeof text != "object" && text != null )
				return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );

			var ret = "";

			jQuery.each( text || this, function(){
				jQuery.each( this.childNodes, function(){
					//排除注释节点
					if( this.nodeType != 8 )
						//如果是元素节点返回nodeValue
						ret += this.nodeType != 1 ?
							this.nodeValue :
							jQuery.fn.text( [text] );
				});
			});

			return ret;
		},
		//将选择器选择的所有元素用指定的html片段包裹
		warpAll: function( html ){
			if( this[0] ){
				jQuery( html, this[0].ownerDocument )
					.clone()
					.insertBefore( this[0] )
					.map(function(){
						var elem = this;

						while( elem.firstChild )
							elem = elem.firstChild;

						return elem;
					})
					.append(this);
			}

			return this;
		},
		//将选择器选择的所有元素的内部元素用指定元素包裹
		warpInner: function( html ){
			return this.each(function(){
				jQuery(this).contents().warpAll( html );
			});
		},
		//追加元素
		append: function(){
			return this.domManip(arguments, true, false, function(elem){
				if( this.nodeType == 1 )
					this.appendChild( elem );
			});
			}
		},
		//过滤指定的元素
		filter: function( selector ){
			return this.pushStack(
				jQuery.isFunction( selector ) &&
				jQuery.grep(this, function(elem, i){
					return selector.call( elem, i );
				}) ||
				jQuery.multiFilter( selector, this );
				);
		}
		//排除指定元素
		not: function( selector ){
			if( selector.constructor == String )
				if ( isSimple.test( selector ) )
					return this.pushStack( jQuery.multiFilter( selector, this, true ) );
				else
					selector = jQuery.multiFilter( selector, this );

			var isArrayLike = selector.length && selector[selector.length-1] !== undefined && !selector.nodeType
			return this.filter(function(){
				return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
			}); 
		},
		//将元素添加到匹配的元素集合中
		add: function( selector ){
			return this.pushStack( jQuery.unique( jQuery.merage(
					this.get(),
					typeof selector == 'string' ?
						//创建新元素
						jQuery( selector ) :
						jQuery.makeArray( selector )
				)));
		},
		//判断是否为指定元素
		is: function( selector ){
			return !!selector && jQuery.multiFilter( selector, this ).length > 0;
		},
		//判断元素是否有某个属性
		hasClass: function( selector ){
			//间接调用multiFilter方法
			return this.is( "." + selector );
		},
		//
		val: function( value ){
			//获取属性值情况
			if( value == undefined ){
				if( this.length ){
					var elem = this[0];

					//处理select下拉框情况
					if( jQuery.nodeName( elem, "select" ) ){
						var index = elem.selectedIndex,
							values = [],
							options = elem.options,
							one = elem.type == "select-one";

						//没有选择
						if( index < 0 )
							return null;

						//遍历所有选择节点
						for( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ){
							var option = options[ i ];

							if( option.selected ){
								//获取被选择框的值
								value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
							
								if( one )
									return value;
								//多选情况则返回多个值
								values.push( value );
							}
						}

						return values;
					//获取指定元素value
					} else
						return ( this[0].value || "" ).replace(/\r/g, "");
				}

				return undefined;
			}

			//将数字参数转化为字符串
			if( value.constructor == Number )
				value += '';

			return this.each(function(){
				//不是元素节点则返回
				if( this.nodeType != 1 )
					return;
				//处理选择框情况
				if( value.constructor == Array && /radio|checkbox/.test( this.type ) )
					this.checked = (jQuery.inArray(this.value, value) >= 0 ||
						jQuery.inArray(this.name, value) >= 0);
				//处理下拉框情况
				else if( jQuery.nodeName( this, "select" ) ){
					var values = jQuery.makeArray(value);

					jQuery( "option", this ).each(function(){
						this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
							jQuery.inArray( this.text, values ) >= 0);
					});

					if( !values.length )
						this.selectedIndex = -1;
				}else
					this.value = value;
			});
		},
		//?
		domManip: function( args, table, reverse, callback ){
			var clone = this.length > 1, elems;

			return this.each(function(){
				if ( !elems ) {
					elems = jQuery.clean( args, this.ownerDocument );

					if ( reverse )
						elems.reverse();
				}

				var obj = this;

				//处理table情况，如果是table则需要加入tbody
				if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
					obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );

				var scripts = jQuery( [] );

				jQuery.each(elems, function(){
					var elem = clone ?
						jQuery( this ).clone( true )[0] :
						this;

					// 处理script脚本，如果脚本可以执行，则进行执行
					if ( jQuery.nodeName( elem, "script" ) )
						scripts = scripts.add( elem );
					else {
						//移除所有的script脚本
						if ( elem.nodeType == 1 )
							scripts = scripts.add( jQuery( "script", elem ).remove() );

						//添加元素至当前对象
						callback.call( obj, elem );
					}
				});

				scripts.each( evalScript );
			});
		}

	};

	//将通过init构造函数实例化对象的原型指向jQuery.prototype
	jQuery.fn.init.prototype = jQuery.fn;

	function evalScript( i, elem ){
		//加载javascript脚本
		if( elem.src )
			jQuery.ajax({
				url: elem.src,
				async: false,
				dataType: "script"
			});
		//执行javascript脚本
		else
			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" )
		
		if ( elem.parentNode )
			elem.parentNode.removeChild( elem );
	}

	function now(){
		return +new Date;
	}
	//jQuery函数扩展
	//静态方法扩展，实例方法扩展
	jQuery.extend = jQuery.fn.extend = function(){

	};

	var expando = "jQuery" + now(), uuid = 0, windowData = {},
		// exclude the following css properties to add px
		exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
		// 存储document 对象所关联的 window 对象
		defaultView = document.defaultView || {};

	//扩展方法
	jQuery.extend({
		//解决类库之间关键字冲突
		noConflict: function(){
			window.$ = _$;

			//jQuery关键字也冲突的情况
			if( deep )
				window.jQuery = _jQuery;
			
			return jQuery;
		},
		//加载执行javascript脚本
		globalEval: function( data ){
			data = jQuery.trim( data );

			if( data ){
				//添加脚本片段至head便签内
				//执行完毕后删除
				var head = document.getElementsByTagName("head")[0] || document.documentElement,
					script = document.createElement("script");

				script.type = "text/javascript";
				if ( jQuery.browser.msie )
					script.text = data;
				else
					script.appendChild( document.createTextNode( data ) );
				//使用insertBefore来避免IE6bug
				head.insertBefore( script, head.firstChild );
				head.removeChild( script );
			}
		},
		//?
		clean: function( elems, context ){
			//?
			var ret = [];
			//作用域范围，默认为HTMLDocument
			context = context || document;
			//在后续会通过createElement创建元素，在IE中document.createElement为'object'，不是'function'
			//通过ownerDocument方式获取document
			if( typeof context.createElement == 'undefined' )
				context = context.ownerDocument || context[0] && context[0].ownerDocument || document;

			jQuery.each(elems, function(i, elem){
				//判断null，undefined与""情况
				if( !elem )
					return;

				//判断数字情况
				if( elem.constructor == Number )
					//转换成字符串
					elem += '';

				if( typeof elem == 'string' ){
					//将单标签转化为双标签
					elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
						return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
							all :
							front + "></" + tag + ">";
					//去除标签中的空白
					var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement('div');

					//?
					var wrap = 
						!tags.indexOf("<opt") &&
						[ 1, "<select multiple='multiple'>", "</select>" ] ||

						!tags.indexOf("<leg") &&
						[ 1, "<fieldset>", "</fieldset>" ] ||

						tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
						[ 1, "<table>", "</table>" ] ||

						!tags.indexOf("<tr") &&
						[ 2, "<table><tbody>", "</tbody></table>" ] ||

					 	// <thead> matched above
						(!tags.indexOf("<td") || !tags.indexOf("<th")) &&
						[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||

						!tags.indexOf("<col") &&
						[ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||

						// IE can't serialize <link> and <script> tags normally
						jQuery.browser.msie &&
						[ 1, "div<div>", "</div>" ] ||

						[ 0, "", "" ];

					//标签包裹
					div.innerHTML = wrap[1] + elem + wrap[2];

					//?
					while( wrap[0]-- )
						div = div.lastChild;

					});

					//?
					if ( jQuery.browser.msie ) {

						// String was a <table>, *may* have spurious <tbody>
						var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
							div.firstChild && div.firstChild.childNodes :

							// String was a bare <thead> or <tfoot>
							wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
								div.childNodes :
								[];

						for ( var j = tbody.length - 1; j >= 0 ; --j )
							if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
								tbody[ j ].parentNode.removeChild( tbody[ j ] );

						// IE completely kills leading whitespace when innerHTML is used
						if ( /^\s/.test( elem ) )
							div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );

					}

					elem = jQuery.makeArray( div.childNodes );
				}

				//没有选择到的元素，并且不是form也不是select
				if( elem.length === 0 && (!jQuery.nodeName( elem, 'form' ) && (!jQuery.nodeName( elem, 'select' ))) )
					return;
				//?
				if( elem[0] == undefined || jQuery.nodeName( elem, 'form' ) || elem.options )
					ret.push( elem );
				else
					ret = jQuery.merage( ret, elem );
			});

			return ret;
		},
		//去除字符串开头与结尾的空格
		trim: function( text ){
			return (text || "").replace( /^\s+|\s+$/g, "" );
		},
		//对象数组
		makeArray: function( array ){
			var ret = [];
			if( array != null ){
				var i =  array.length;
				//确定array为数组对象
				if( i == null || array.split || array.setInterval || array.call )
					ret[0] = array;
				else
					while( i )
						ret[--i] = array[i];
			}

			return ret;
		},
		//判断元素名是否为name
		nodeName: function( elem, name ){
			return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
		},
		cache: {},
		//为指定元素添加key value数据
		//https://api.jquery.com/jquery.data/
		data: function( elem, name, data ){
			//判断对象是否为window
			elem = elem == window ?
				windowData :
				elem;
			var id = elem[ expando ];

			if( !id )
				id = elem[ expando ] = ++uuid;

			if( name && !jQuery.cache[ id ] )
				jQuery.cache[ id ] = {};

			if( data != undefined )
				jQuery.cache[ id ][ name ] = data;

			return name ?
				jQuery.cache[ id ][ name ] : 
				id;
		}
		//判断元素是否为function
		isFunction: function( fn ) {
			return !!fn && typeof fn != "string" && !fn.nodeName &&
				fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
		},
		//判断元素是否为XML document
		isXMLDoc: function( elem ) {
			return elem.documentElement && !elem.body ||
				elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
		},
		//args参数只在内部使用
		each: function( object, callback, args ){
			var name, i = 0, length = object.length;

			if( args ){
				if( length == undefined ){
					for( name in object )
						if( callback.apply( object[name], args ) === false)
							break;
				}else
					for( ; i<length; )
						if( callback.apply( object[ i++ ], args ) === false )
							break;
			}else{
				if ( length == undefined ) {
				for ( name in object )
					if ( callback.call( object[ name ], name, object[ name ] ) === false )
						break;
				} else
					for ( var value = object[0];
						i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
			}
			return object;
		},
		//获取元素样式属性值
		curCSS: function( elem, name, force ){
			//初始化元素的style属性
			var ret, style = elem.style;

			//判断元素样式是否失效
			function color( elem ){
				if( !jQuery.browser.safari )
					return false;

				var ret = defaultView.getComputedStyle( elem, null );
				return !ret || ret.getPropertyValue("color") == "";
			}

			// We need to handle opacity special in IE
			if ( name == "opacity" && jQuery.browser.msie ) {
				ret = jQuery.attr( style, "opacity" );

				return ret == "" ?
					"1" :
					ret;
			}

			// Opera sometimes will give the wrong display answer, this fixes it, see #2037
			if ( jQuery.browser.opera && name == "display" ) {
				var save = style.outline;
				style.outline = "0 solid black";
				style.outline = save;
			}

			// Make sure we're using the right name for getting the float value
			if ( name.match( /float/i ) )
				name = styleFloat;

			if ( !force && style && style[ name ] )
				ret = style[ name ];

			else if( defaultView.getComputedStyle ){

				//处理"float"情况
				if( name.match( /float/i ) )
					name = "float";

				name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();

				//获取元素所有样式
				var computedStyle = defaultView.getComputedStyle( elem, null );
				//获取指定样式
				if( computedStyle && !color( elem ) )
					ret = computedStyle.getPropertyValue( name );
				//处理无法获取元素样式的情况
				else {
					var swap = [], stack = [], a = elem, i = 0;

					//将当前节点的所有父节点压入栈中
					for( ; a && color(a); a = a.parentNode )
						stack.unshift(a)

					//将栈中的元素全部置为可视状态
					for( ; i < stack.length; i++ )
						if( color( stack[ i ] ) ){
							swap[ i ] = stack[ i ].style.display;
							stack[ i ].style.display = "block";
						}

					//处理指定样式为display的情况
					ret = name == "display" && swap[ stack.length - 1 ] != null ?
						"none" :
						( computedStyle && computedStyle.getPropertyValue( name ) ) || "";

					//恢复display属性
					for( i = 0; i < swap.length; i++ )
						if( swap[ i ] != null )
							stack[i].style.display = swap[i];
				}

				// We should always get a number back from opacity
				if ( name == "opacity" && ret == "" )
					ret = "1";
			//IE情况
			} else if( elem.currentStyle ){
				var camelCase = name.replace(/\-(\w)/g, function(all, letter){
					return letter.toUpperCase();
				});

				ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];

				// From the awesome hack by <NAME>
				// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291

				// If we're not dealing with a regular pixel number
				// but a number that has a weird ending, we need to convert it to pixels
				if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
					// Remember the original values
					var left = style.left, rsLeft = elem.runtimeStyle.left;

					// Put in the new values to get a computed value out
					elem.runtimeStyle.left = elem.currentStyle.left;
					style.left = ret || 0;
					ret = style.pixelLeft + "px";

					// Revert the changed values
					style.left = left;
					elem.runtimeStyle.left = rsLeft;
				}
			}
			return ret;
		},
		//操作元素属性
		attr: function( elem, name, value ){
			//排除在文本节点，注释节点上设置属性
			if( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
				return undefined;

			var notxml = !jQuery.isXMLDoc( elem ),
				set = value !== undefined,
				msie = jQuery.browser.msie;

			//在非xml文档类型下修正一些属性名
			name = notxml && jQuery.props[ name ] || name;

			if( elem.tagName ){
				//特殊的属性
				var special = /href|src|style/.test(name);
				// Safari mis-reports the default selected property of a hidden option
				// Accessing the parent's selectedIndex property fixes it
				if ( name == "selected" && jQuery.browser.safari )
					elem.parentNode.selectedIndex;

				if( name in elem && notxml && !special ){
					if( set ){
						//不能修改input的type属性
						if( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
							throw "type property can't be changed";

						elem[ name ] = value;
					}
					if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
						return elem.getAttributeNode( name ).nodeValue;

					return elem[name];
				}

				//此处有问题，后续jQuery版本中进行了更正
				if( msie && notxml && name == "style" )
					return jQuery.attr( elem.style, "cssText", value );
				
				if( set )
					elem.setAttribute( name, "" + value );

				var attr = msie && notxml && special
						? elem.getAttribute( name, 2 )
						: elem.getAttribute( name );

				return attr === null ? undefined : attr;
			}

			// IE uses filters for opacity
			if ( msie && name == "opacity" ) {
				if ( set ) {
					// IE has trouble with opacity if it does not have layout
					// Force it by setting the zoom level
					elem.zoom = 1;

					// Set the alpha filter to set the opacity
					elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
						(parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
				}

				return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
					"";
			}

			name = name.replace(/-([a-z])/ig, function(all, letter){
				return letter.toUpperCase();
			});

			if ( set )
				elem[ name ] = value;

			return elem[ name ];
		},
		//判断元素是否在数组中，并返回所在位置下标
		inArray: function( elem, array ){
			for( var i = 0, length = array.length; i < length; i++ )
				if( array[ i ] === elem )
					return i;
			return -1;
		},
		//将第二个参数中的元素合并至第一个参数中
		merage: function( first, second ){
			var i = 0, elem, pos = first.length;

			//兼容ie
			if( jQuery.browser.msie ){
				while( elem = second[ i++ ] )
					if( elem.nodeType !=8 )
						first[ pos++ ] = elem;
			}else
				while ( elem = second[ i++ ] )
					first[ pos++ ] = elem;

			return first;
		},
		//！进行数组去重，此方法在此版本有一些问题
		unique: function( array ){
			var ret = [], done = {};

			try{
				for( var i = 0, length = array.length; i<length; i++ ){
					//调用data方法返回一个唯一的id
					var id = jQuery.data( array[ i ] );

					if( !done[ id ] ){
						done[ id ] = true;
						ret.push( array[ i ] );
					}
				}
			} catch( e ){
				ret = array;
			}
			return ret;
		},
		//根据指定条件过滤元素
		grep: function( elems, callback, inv ){
			var ret = [];

			for( var i = 0, length = elems.length; i < length; i++ )
				if( !inv !=callback( elems[i], i ) )
					ret.push( elems[ i ] );

			return ret;
		}
		//对指定元素作为callback参数进行处理
		//callback参数1.dom元素 2.index
		map:function( elems, callback ){
			var ret = [];
			for( var i = 0, length = elems.length; i < length; i++ ){
				var value = callback( elems[ i ], i );

				if( value != null )
					ret[ ret.length ] = value
			}

			return ret.concat.apply( [], ret );
		}
	});
{'fraction_non_alphanumeric': 0.16689694601934346, 'fraction_numerical': 0.005836390490256801, 'mean_word_length': 2.379679574913453, 'pattern_counts': {'":': 0, '<': 122, '<?xml version=': 0, '>': 98, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '1115813', 'n_tokens_mistral': 19635, 'n_tokens_neox': 15937, 'n_words': 3416}