<commit_before>
"use strict";

// deps

const 	fs = require('fs'),
		path = require('path');

// module

fs.dirExists = function(dir) {

	var bResult = false;

		try {

			if ('string' === typeof dir && fs.lstatSync(dir).isDirectory()) {
				bResult = true;
			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

fs.fileExists = function(file) {

	var bResult = false;

		try {

			if ('string' === typeof file && fs.lstatSync(file).isFile()) {
				bResult = true;
			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

fs.mkdirp = function(dir) {

	var bResult = false;

		try {

			if (fs.dirExists(dir)) {
				bResult = true;
			}
			else if (fs.dirExists(path.dirname(dir)) || fs.mkdirp(path.dirname(dir))) {
				fs.mkdirSync(dir, parseInt('0777', 8));
				bResult = true;
			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

fs.rmdirp = function(dir) {

	var bResult = false;

		try {

			if(!fs.dirExists(dir)) {
				bResult = true;
			}
			else {

				fs.readdirSync(dir).forEach(function(file) {

					var curPath = path.join(dir, file);

					if(fs.dirExists(curPath)) {
						fs.rmdirp(curPath);
					}
					else {
						fs.unlinkSync(curPath);
					}

				});

				fs.rmdirSync(dir);

				bResult = true;

			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

module.exports = fs;<commit_msg>correction<commit_after>
"use strict";

// deps

const 	fs = require('fs'),
		path = require('path');

// module

fs.dirExists = function(dir) {

	var bResult = false;

		try {

			if ('string' === typeof dir && fs.lstatSync(dir).isDirectory()) {
				bResult = true;
			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

fs.fileExists = function(file) {

	var bResult = false;

		try {

			if ('string' === typeof file && fs.lstatSync(file).isFile()) {
				bResult = true;
			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

fs.mkdirp = function(dir) {

	var bResult = false;

		try {

			if (fs.dirExists(dir)) {
				bResult = true;
			}
			else if (fs.dirExists(path.dirname(dir)) || fs.mkdirp(path.dirname(dir))) {
				fs.mkdirSync(dir, parseInt('0777', 8));
				bResult = true;
			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

fs.rmdirp = function(dir) {

	var bResult = false;

		try {

			if(!fs.dirExists(dir)) {
				bResult = true;
			}
			else {

				fs.readdirSync(dir).forEach(function(file) {

					var curPath = path.join(dir, file);

					if(fs.dirExists(curPath)) {
						fs.rmdirp(curPath);
					}
					else if (fs.fileExists(curPath)) {
						fs.unlinkSync(curPath);
					}

				});

				fs.rmdirSync(dir);

				bResult = true;

			}

		}
		catch (e) {
			bResult = false;
		}

	return bResult;

};

module.exports = fs;
{'fraction_non_alphanumeric': 0.16528028933092223, 'fraction_numerical': 0.003616636528028933, 'mean_word_length': 2.3814180929095357, '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': '1471869', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1068, 'n_words': 207}