<commit_before>/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author <NAME> @sokra
*/
var path = require("path");
var fs = require("fs");

// http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...


function resolve(context, identifier, options, type, callback) {
	function finalResult(err, absoluteFilename) {
		if(err) {
			callback("Module \"" + identifier + "\" not found in context \"" +
						context + "\"\n  " + err);
			return;
		}
		callback(null, absoluteFilename);
	}
	var identArray = split(identifier);
	var contextArray = split(context);
	while(options.alias[identArray[0]]) {
		var old = identArray[0];
		identArray[0] = options.alias[identArray[0]];
		identArray = split(path.join.apply(path, identArray));
		if(identArray[0] === old)
			break;
	}
	if(identArray[0] === "." || identArray[0] === ".." || identArray[0] === "" || identArray[0].match(/^[A-Z]:$/i)) {
		var pathname = identArray[0][0] === "." ? join(contextArray, identArray) : path.join.apply(path, identArray);
		loadAsFile(pathname, options, type, function(err, absoluteFilename) {
			if(err) {
				loadAsDirectory(pathname, options, type, finalResult);
				return;
			}
			callback(null, absoluteFilename);
		});
	} else {
		loadNodeModules(contextArray, identArray, options, type, finalResult);
	}
}

/**
 * context: absolute filename of current file
 * identifier: module to find
 * options:
 *   paths: array of lookup paths
 * callback: function(err, absoluteFilename)
 */
module.exports = function(context, identifier, options, callback) {
	if(!callback) {
		callback = options;
		options = {};
	}
	if(!options)
		options = {};
	if(!options.extensions)
		options.extensions = ["", ".webpack.js", ".web.js", ".js"];
	if(!options.loaders)
		options.loaders = [];
	if(!options.postfixes)
		options.postfixes = ["", "-webpack", "-web"];
	if(!options.loaderExtensions)
		options.loaderExtensions = [".webpack-web-loader.js", ".webpack-loader.js", ".web-loader.js", ".loader.js", ".js", ""];
	if(!options.loaderPostfixes)
		options.loaderPostfixes = ["-webpack-web-loader", "-webpack-loader", "-web-loader", "-loader", ""];
	if(!options.paths)
		options.paths = [];
	if(!options.alias)
		options.alias = {};
	var identifiers = identifier.split(/!/g);
	if(identifiers.length === 1) {
		var resource = identifiers.pop();
		for(var i = 0; i < options.loaders.length; i++) {
			var line = options.loaders[i];
			if(line.test.test(resource)) {
				identifiers.push(line.loader);
				break;
			}
		}
		identifiers.push(resource);
	}
	var errors = [];
	var count = identifiers.length;
	function endOne() {
		count--;
		if(count === 0) {
			if(errors.length > 0) {
				callback(errors.join("\n"));
				return;
			}
			callback(null, identifiers.join("!"));
		}
	}
	identifiers.forEach(function(ident, index) {<commit_msg>small fix<commit_after>/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author <NAME> @sokra
*/
var path = require("path");
var fs = require("fs");

// http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...


function resolve(context, identifier, options, type, callback) {
	function finalResult(err, absoluteFilename) {
		if(err) {
			callback("Module \"" + identifier + "\" not found in context \"" +
						context + "\"\n  " + err);
			return;
		}
		callback(null, absoluteFilename);
	}
	var identArray = split(identifier);
	var contextArray = split(context);
	while(options.alias[identArray[0]]) {
		var old = identArray[0];
		identArray[0] = options.alias[identArray[0]];
		identArray = split(path.join.apply(path, identArray));
		if(identArray[0] === old)
			break;
	}
	if(identArray[0] === "." || identArray[0] === ".." || identArray[0] === "" || identArray[0].match(/^[A-Z]:$/i)) {
		var pathname = identArray[0][0] === "." ? join(contextArray, identArray) : path.join.apply(path, identArray);
		loadAsFile(pathname, options, type, function(err, absoluteFilename) {
			if(err) {
				loadAsDirectory(pathname, options, type, finalResult);
				return;
			}
			callback(null, absoluteFilename);
		});
	} else {
		loadNodeModules(contextArray, identArray, options, type, finalResult);
	}
}

/**
 * context: absolute filename of current file
 * identifier: module to find
 * options:
 *   paths: array of lookup paths
 * callback: function(err, absoluteFilename)
 */
module.exports = function(context, identifier, options, callback) {
	if(!callback) {
		callback = options;
		options = {};
	}
	if(!options)
		options = {};
	if(!options.extensions)
		options.extensions = ["", ".webpack.js", ".web.js", ".js"];
	if(!options.loaders)
		options.loaders = [];
	if(!options.postfixes)
		options.postfixes = ["", "-webpack", "-web"];
	if(!options.loaderExtensions)
		options.loaderExtensions = [".webpack-web-loader.js", ".webpack-loader.js", ".web-loader.js", ".loader.js", "", ".js"];
	if(!options.loaderPostfixes)
		options.loaderPostfixes = ["-webpack-web-loader", "-webpack-loader", "-web-loader", "-loader", ""];
	if(!options.paths)
		options.paths = [];
	if(!options.alias)
		options.alias = {};
	var identifiers = identifier.split(/!/g);
	if(identifiers.length === 1) {
		var resource = identifiers.pop();
		for(var i = 0; i < options.loaders.length; i++) {
			var line = options.loaders[i];
			if(line.test.test(resource)) {
				identifiers.push(line.loader);
				break;
			}
		}
		identifiers.push(resource);
	}
	var errors = [];
	var count = identifiers.length;
	function endOne() {
		count--;
		if(count === 0) {
			if(errors.length > 0) {
				callback(errors.join("\n"));
				return;
			}
			callback(null, identifiers.join("!"));
		}
	}
	identifiers.forEach(function(ident, index) {
{'fraction_non_alphanumeric': 0.19091554293825408, 'fraction_numerical': 0.0063875088715401, 'mean_word_length': 4.051075268817204, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5236361', 'n_tokens_mistral': 2061, 'n_tokens_neox': 1880, 'n_words': 363}