<commit_before>'use strict';
var os = require('os');
var padStdio = require('pad-stdio');
var async = require('async');
var cpCache = [];

module.exports = function (grunt) {
	grunt.registerMultiTask('concurrent', 'Run grunt tasks concurrently', function () {
		var spawnOptions;
		var cb = this.async();
		var options = this.options({
			limit: Math.max((os.cpus().length || 1) * 2, 2)
		});
		// Set the tasks based on the config format
		var tasks = this.data.tasks || this.data;

		// Warning if there are too many tasks to execute within the given limit
		if (options.limit < tasks.length) {
			grunt.log.oklns(
				'Warning: There are more tasks than your concurrency limit. After ' +
				'this limit is reached no further tasks will be run until the ' +
				'current tasks are completed. You can adjust the limit in the ' +
				'concurrent task options'
			);
		}

		// Optionally log the task output
		if (options.logConcurrentOutput) {
		    spawnOptions = { stdio: ['ignore', process.stdout, process.stderr] };
		}

		padStdio.stdout('    ');
		async.eachLimit(tasks, options.limit, function (task, next) {
			var cp = grunt.util.spawn({
				grunt: true,
				args: [task].concat(grunt.option.flags()),
				opts: spawnOptions
			}, function (err, result, code) {
				if (err || code > 0) {
					grunt.warn(result.stderr || result.stdout);
				}
				grunt.log.writeln('\n' + result.stdout);
				next();
			});

			cpCache.push(cp);
		}, function () {
			padStdio.stdout();
			cb();
		});
	});
};

// make sure all child processes are killed when grunt exits
process.on('exit', function () {
	cpCache.forEach(function (el) {
		el.kill();
	});
});<commit_msg>force kill all child processes<commit_after>'use strict';
var os = require('os');
var padStdio = require('pad-stdio');
var async = require('async');
var cpCache = [];

module.exports = function (grunt) {
	grunt.registerMultiTask('concurrent', 'Run grunt tasks concurrently', function () {
		var spawnOptions;
		var cb = this.async();
		var options = this.options({
			limit: Math.max((os.cpus().length || 1) * 2, 2)
		});
		// Set the tasks based on the config format
		var tasks = this.data.tasks || this.data;

		// Warning if there are too many tasks to execute within the given limit
		if (options.limit < tasks.length) {
			grunt.log.oklns(
				'Warning: There are more tasks than your concurrency limit. After ' +
				'this limit is reached no further tasks will be run until the ' +
				'current tasks are completed. You can adjust the limit in the ' +
				'concurrent task options'
			);
		}

		// Optionally log the task output
		if (options.logConcurrentOutput) {
		    spawnOptions = { stdio: ['ignore', process.stdout, process.stderr] };
		}

		padStdio.stdout('    ');
		async.eachLimit(tasks, options.limit, function (task, next) {
			var cp = grunt.util.spawn({
				grunt: true,
				args: [task].concat(grunt.option.flags()),
				opts: spawnOptions
			}, function (err, result, code) {
				if (err || code > 0) {
					grunt.warn(result.stderr || result.stdout);
				}
				grunt.log.writeln('\n' + result.stdout);
				next();
			});

			cpCache.push(cp);
		}, function () {
			padStdio.stdout();
			cb();
		});
	});
};

// make sure all child processes are killed when grunt exits
process.on('exit', function () {
	cpCache.forEach(function (el) {
		el.kill('SIGKILL');
	});
});
{'fraction_non_alphanumeric': 0.14958283671036948, 'fraction_numerical': 0.0023837902264600714, 'mean_word_length': 3.2439949431099873, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3667582', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1056, 'n_words': 322}