<commit_before>/** MIT License (c) copyright 2010-2013 <NAME> & <NAME> */

/**
 * curl CommonJS Modules/1.1 loader
 *
 * This loader loads modules that conform to the CommonJS Modules/1.1 spec.
 * The loader also accommodates node.js, which  adds features beyond the
 * spec, such as `module.exports` and `this === exports`.
 *
 * CommonJS modules can't run in browser environments without help. This
 * loader wraps the modules in AMD and injects the CommonJS "free vars":
 *
 * define(function (require, exports, module) {
 *     // CommonJS code goes here.
 * });
 *
 * Config options:
 *
 * `injectSourceUrl` {boolean} If truthy (default), a //@sourceURL is injected
 * into the script so that debuggers may display a meaningful name in the
 * list of scripts. Setting this to false may save a few bytes.
 *
 * `injectScript` {boolean} If truthy, a <script> element will be inserted,
 * rather than using a global `eval()` to execute the module.  You typically
 * won't need to use this option.
 *
 * `dontAddFileExt` {RegExp|string} An expression that determines when *not*
 * to add a '.js' extension onto a url when fetching a module from a server.
 */

(function (global, document, globalEval) {

define(/*=='curl/loader/cjsm11',==*/ ['../plugin/_fetchText', 'curl/_privileged'], function (fetchText, priv) {

	var head, insertBeforeEl, extractCjsDeps, checkToAddJsExt;

	head = document && (document['head'] || document.getElementsByTagName('head')[0]);
	// to keep IE from crying, we need to put scripts before any
	// <base> elements, but after any <meta>. this should do it:
	insertBeforeEl = head && head.getElementsByTagName('base')[0] || null;

	extractCjsDeps = priv['core'].extractCjsDeps;
	checkToAddJsExt = priv['core'].checkToAddJsExt;

	function wrapSource (source, resourceId, fullUrl) {
		var sourceUrl = fullUrl ? '/*\n////@ sourceURL=' + fullUrl.replace(/\s/g, '%20') + '.js\n*/' : '';
		return "define('" + resourceId + "'," +
			"['require','exports','module'],function(require,exports,module){" +
			source + "\n});\n" + sourceUrl + "\n";
	}

	var injectSource = function (el, source) {
		// got this from Sto<NAME>ov (http://www.phpied.com/dynamic-script-and-style-elements-in-ie/)
		injectSource = ('text' in el) ?<commit_msg>Ensure that `define` is undefined when wrapping cjs/node modules.<commit_after>/** MIT License (c) copyright 2010-2013 <NAME> & <NAME> */

/**
 * curl CommonJS Modules/1.1 loader
 *
 * This loader loads modules that conform to the CommonJS Modules/1.1 spec.
 * The loader also accommodates node.js, which  adds features beyond the
 * spec, such as `module.exports` and `this === exports`.
 *
 * CommonJS modules can't run in browser environments without help. This
 * loader wraps the modules in AMD and injects the CommonJS "free vars":
 *
 * define(function (require, exports, module) {
 *     // CommonJS code goes here.
 * });
 *
 * Config options:
 *
 * `injectSourceUrl` {boolean} If truthy (default), a //@sourceURL is injected
 * into the script so that debuggers may display a meaningful name in the
 * list of scripts. Setting this to false may save a few bytes.
 *
 * `injectScript` {boolean} If truthy, a <script> element will be inserted,
 * rather than using a global `eval()` to execute the module.  You typically
 * won't need to use this option.
 *
 * `dontAddFileExt` {RegExp|string} An expression that determines when *not*
 * to add a '.js' extension onto a url when fetching a module from a server.
 */

(function (global, document, globalEval) {

define(/*=='curl/loader/cjsm11',==*/ ['../plugin/_fetchText', 'curl/_privileged'], function (fetchText, priv) {

	var head, insertBeforeEl, extractCjsDeps, checkToAddJsExt;

	head = document && (document['head'] || document.getElementsByTagName('head')[0]);
	// to keep IE from crying, we need to put scripts before any
	// <base> elements, but after any <meta>. this should do it:
	insertBeforeEl = head && head.getElementsByTagName('base')[0] || null;

	extractCjsDeps = priv['core'].extractCjsDeps;
	checkToAddJsExt = priv['core'].checkToAddJsExt;

	function wrapSource (source, resourceId, fullUrl) {
		var sourceUrl = fullUrl ? '/*\n////@ sourceURL=' + fullUrl.replace(/\s/g, '%20') + '.js\n*/' : '';
		return "define('" + resourceId + "'," +
			"['require','exports','module'],function(require,exports,module){var define;" +
			source + "\n});\n" + sourceUrl + "\n";
	}

	var injectSource = function (el, source) {
		// got this from <NAME> (http://www.phpied.com/dynamic-script-and-style-elements-in-ie/)
		injectSource = ('text' in el) ?
{'fraction_non_alphanumeric': 0.14682713347921225, 'fraction_numerical': 0.00787746170678337, 'mean_word_length': 4.090200445434299, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 15, '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': '2234792', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1393, 'n_words': 491}