<commit_before>module.exports = function (grunt) {

	"use strict";

	var libDir = "./lib/",
		lang = require(libDir + "lang"),
		normalizeCfg = require(libDir + "normalizeConfig");

	grunt.registerTask("amdserialize", function (layerName, buildCfg, outputProp) {
		var buildConfig = normalizeCfg.build(grunt.config(buildCfg));
		var layerConfig = buildConfig.layersByName[layerName];
		var dir = buildConfig.dir;
		var modulesFiles = {
			abs: [],
			rel: []
		};
		var pluginsFiles = {
			abs: [],
			rel: []
		};

		layerConfig.shim.forEach(function (shim) {
			var absPath = dir + shim.filepath;

			grunt.file.write(absPath, shim.content);
			modulesFiles.abs.push(absPath);
			modulesFiles.rel.push(shim.filepath);
		});

		lang.forEachModules(layerConfig.modules, layerName, function (module) {
			if (!module.filepath) {
				grunt.fail.warn("Undefined Path " + module.mid);
			}

			var path = dir + module.filepath;
			grunt.file.write(path, module.content);
			modulesFiles.abs.push(path);
			modulesFiles.rel.push(module.filepath);
		});

		lang.eachProp(layerConfig.pluginsFiles, function (filepath, content) {
			var absPath = dir + filepath;

			// Process images included in css with url() param.
			if (/.css$/.test(filepath)) {
				var fileDir = filepath.replace(/[^\/]*$/, "");
				var urlRE = /url\(['"]?([^\)'"]*)/g;
				var match = null;
				// Extra parenthesis in the while condition to silence jshint.
				// The assignment is required here to access the matched groups of a global regexp.
				while ((match = urlRE.exec(content))) {
					var src = fileDir + match[1];<commit_msg>Fix errors when building Bootstrap CSS. Add support for url containing # and ?. Add support for url starting with ../<commit_after>module.exports = function (grunt) {

	"use strict";

	var libDir = "./lib/",
		lang = require(libDir + "lang"),
		normalizeCfg = require(libDir + "normalizeConfig");

	grunt.registerTask("amdserialize", function (layerName, buildCfg, outputProp) {
		var buildConfig = normalizeCfg.build(grunt.config(buildCfg));
		var layerConfig = buildConfig.layersByName[layerName];
		var dir = buildConfig.dir;
		var modulesFiles = {
			abs: [],
			rel: []
		};
		var pluginsFiles = {
			abs: [],
			rel: []
		};

		layerConfig.shim.forEach(function (shim) {
			var absPath = dir + shim.filepath;

			grunt.file.write(absPath, shim.content);
			modulesFiles.abs.push(absPath);
			modulesFiles.rel.push(shim.filepath);
		});

		lang.forEachModules(layerConfig.modules, layerName, function (module) {
			if (!module.filepath) {
				grunt.fail.warn("Undefined Path " + module.mid);
			}

			var path = dir + module.filepath;
			grunt.file.write(path, module.content);
			modulesFiles.abs.push(path);
			modulesFiles.rel.push(module.filepath);
		});

		lang.eachProp(layerConfig.pluginsFiles, function (filepath, content) {
			var absPath = dir + filepath;

			// Process images included in css with url() param.
			if (/.css$/.test(filepath)) {
				var fileDir = filepath.replace(/[^\/]*$/, "");
				var urlRE = /url\(['"]?([^\)'"\?#]*)/g;
				var match = null;

				// This is needed in case of relative path using ../, because grunt.file.copy while try to go down to
				// fileDir before going up with ../ So if fileDir does not exist grunt.file.copy fails.
				grunt.file.mkdir(fileDir);

				// Extra parenthesis in the while condition to silence jshint.
				// The assignment is required here to access the matched groups of a global regexp.
				while ((match = urlRE.exec(content))) {
					var src = fileDir + match[1];
{'fraction_non_alphanumeric': 0.14700902934537247, 'fraction_numerical': 0.000564334085778781, 'mean_word_length': 3.459119496855346, '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': '6305851', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1130, 'n_words': 288}