<commit_before>dojo.provide("dojox.help._base");
dojo.require("dojox.rpc.Service");
dojo.require("dojo.io.script");

dojo.experimental("dojox.help");
console.warn("Script causes side effects (on numbers, strings, and booleans). Call dojox.help.noConflict() if you plan on executing code.");

dojox.help = {
	// summary:
	//		Adds the help function to all variables.
	locate: function(/*String*/ searchFor, /*String|Object|String[]|Object[]*/ searchIn, /*Number*/ maxResults){
		// summary:
		//		Search for dojo functionality that has something to do with the given string.
		//  description:
		//		Search for locally available data; variable names and any cached
		//		documentation results for matches containing our search parameter
		// searchFor
		//		The string to search for.
		// searchIn:
		//		The namespaces to search in. Defaults to dojox.help._namespaces
		// maxResults:
		//		The maximum number of results.
		maxResults = maxResults || 20;
		var namespaces = [];
		var roots = {};
		var root;
		if(searchIn){
			if(!dojo.isArray(searchIn)){
				searchIn = [searchIn];
			}
			for(var i = 0, namespace; namespace = searchIn[i]; i++){
				root = namespace;
				if(dojo.isString(namespace)){
					namespace = dojo.getObject(namespace);
					if(!namespace){
						continue;
					}
				}else if(dojo.isObject(namespace)){
					root = namespace.__name__;
				}else{
					continue;
				}
				// Add to a list of namespace objects (in object form)
				namespaces.push(namespace);
				if(root){
					root = root.split(".")[0];
					if(!roots[root] && dojo.indexOf(dojox.help._namespaces, root) == -1){
						// Refresh anything that's not part of our global namespace list
						dojox.help.refresh(root);
					}
					roots[root] = true;
				}
			}
		}
		if(!namespaces.length){
			namespaces.push({ __name__: "window" });
			dojo.forEach(dojox.help._namespaces, function(item){ roots[item] = true; });
		}

		var found = [];
		out:
		for(var i = 0, namespace; namespace = namespaces[i]; i++){
			var name = namespace.__name__ || "";
			var shorter = dojo.some(namespaces, function(item){
				// Return true if we find a namespace below
				// the current namespace
				item = item.__name__ || "";
				return (name.indexOf(item + ".") == 0);
			});
			if(name && !shorter){
				root = name.split(".")[0];
				var names = [];
				if(name == "window"){
					for(root in dojox.help._names){
						if(dojo.isArray(dojox.help._names[root])){
							names = names.concat(dojox.help._names[root]);
						}
					}
				}else{
					names = dojox.help._names[root];
				}
				for(var j = 0, variable; variable = names[j]; j++){
					if((name == "window" || variable.indexOf(name + ".") == 0) && variable.indexOf(searchFor) != -1){
						if(variable.slice(-10) == ".prototype"){ continue; }
						var obj = dojo.getObject(variable);
						if(obj){
							found.push([variable, obj]);
							if(found.length == maxResults){
								break out;
							}
						}
					}
				}
			}
		}

		dojox.help._displayLocated(found);
		if(!+dojo.isFF){
			return "";
		}
	},
	refresh: function(/*String?*/ namespace, /*Boolean?*/ recursive){
		// summary:<commit_msg>Refs #6202. Perform locate case-insensitively !strict<commit_after>dojo.provide("dojox.help._base");
dojo.require("dojox.rpc.Service");
dojo.require("dojo.io.script");

dojo.experimental("dojox.help");
console.warn("Script causes side effects (on numbers, strings, and booleans). Call dojox.help.noConflict() if you plan on executing code.");

dojox.help = {
	// summary:
	//		Adds the help function to all variables.
	locate: function(/*String*/ searchFor, /*String|Object|String[]|Object[]*/ searchIn, /*Number*/ maxResults){
		// summary:
		//		Search for dojo functionality that has something to do with the given string.
		//  description:
		//		Search for locally available data; variable names and any cached
		//		documentation results for matches containing our search parameter
		// searchFor
		//		The string to search for.
		// searchIn:
		//		The namespaces to search in. Defaults to dojox.help._namespaces
		// maxResults:
		//		The maximum number of results.
		maxResults = maxResults || 20;
		var namespaces = [];
		var roots = {};
		var root;
		if(searchIn){
			if(!dojo.isArray(searchIn)){
				searchIn = [searchIn];
			}
			for(var i = 0, namespace; namespace = searchIn[i]; i++){
				root = namespace;
				if(dojo.isString(namespace)){
					namespace = dojo.getObject(namespace);
					if(!namespace){
						continue;
					}
				}else if(dojo.isObject(namespace)){
					root = namespace.__name__;
				}else{
					continue;
				}
				// Add to a list of namespace objects (in object form)
				namespaces.push(namespace);
				if(root){
					root = root.split(".")[0];
					if(!roots[root] && dojo.indexOf(dojox.help._namespaces, root) == -1){
						// Refresh anything that's not part of our global namespace list
						dojox.help.refresh(root);
					}
					roots[root] = true;
				}
			}
		}
		if(!namespaces.length){
			namespaces.push({ __name__: "window" });
			dojo.forEach(dojox.help._namespaces, function(item){ roots[item] = true; });
		}

		var found = [];
		out:
		for(var i = 0, namespace; namespace = namespaces[i]; i++){
			var name = namespace.__name__ || "";
			var shorter = dojo.some(namespaces, function(item){
				// Return true if we find a namespace below
				// the current namespace
				item = item.__name__ || "";
				return (name.indexOf(item + ".") == 0);
			});
			if(name && !shorter){
				root = name.split(".")[0];
				var names = [];
				if(name == "window"){
					for(root in dojox.help._names){
						if(dojo.isArray(dojox.help._names[root])){
							names = names.concat(dojox.help._names[root]);
						}
					}
				}else{
					names = dojox.help._names[root];
				}
				for(var j = 0, variable; variable = names[j]; j++){
					if((name == "window" || variable.indexOf(name + ".") == 0) && variable.toLowerCase().indexOf(searchFor) != -1){
						if(variable.slice(-10) == ".prototype"){ continue; }
						var obj = dojo.getObject(variable);
						if(obj){
							found.push([variable, obj]);
							if(found.length == maxResults){
								break out;
							}
						}
					}
				}
			}
		}

		dojox.help._displayLocated(found);
		if(!+dojo.isFF){
			return "";
		}
	},
	refresh: function(/*String?*/ namespace, /*Boolean?*/ recursive){
		// summary:
{'fraction_non_alphanumeric': 0.16188524590163936, 'fraction_numerical': 0.004728877679697352, 'mean_word_length': 2.8902513795217657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3655184', 'n_tokens_mistral': 2599, 'n_tokens_neox': 2067, 'n_words': 500}