<commit_before>var path = require('path');
var config = require('../config');
var paths = module.paths.map(formatPath);
var globalDir = formatPath(getGlobalDir());
var appDataDir = formatPath(process.env && process.env.APPDATA);

paths.unshift(formatPath(path.join(config.DATA_DIR, 'plugins')));

if (appDataDir && paths.indexOf(appDataDir) == -1) {
	paths.push(path.join(appDataDir, 'npm/node_modules'));
}

if (globalDir && paths.indexOf(globalDir) == -1) {
	paths.push(globalDir);
}

function formatPath(path) {
	return typeof path == 'string' ? path.replace(/\\/g, '/') : null;
}

function getGlobalDir() {
	var globalPrefix;
	if (process.env.PREFIX) {
	   globalPrefix = process.env.PREFIX;
	} else if (process.platform === 'win32') {
	   globalPrefix = path.dirname(process.execPath);
	} else {
	   globalPrefix = path.dirname(path.dirname(process.execPath));<commit_msg>feat: Add WHISTLE_PLUGINS_PATH to plugin paths<commit_after>var path = require('path');
var config = require('../config');
var paths = module.paths.map(formatPath);
var globalDir = formatPath(getGlobalDir());
var appDataDir = formatPath(process.env && process.env.APPDATA);
var pluginsPath = formatPath(path.join(config.DATA_DIR, 'node_modules'));

if (paths.indexOf(pluginsPath) == -1) {
	paths.unshift(pluginsPath);
}

pluginsPath = process.env && process.env.WHISTLE_PLUGINS_PATH;
if (pluginsPath && typeof pluginsPath == 'string') {
	pluginsPath = formatPath(path.join(pluginsPath, 'node_modules'));
	paths.indexOf(pluginsPath) == -1 && paths.unshift(pluginsPath);
}

if (appDataDir) {
	appDataDir = path.join(appDataDir, 'npm/node_modules');
	paths.indexOf(appDataDir) == -1 && paths.push(appDataDir);
}

if (globalDir && paths.indexOf(globalDir) == -1) {
	paths.push(globalDir);
}

function formatPath(path) {
	return typeof path == 'string' ? path.replace(/\\/g, '/') : null;
}

function getGlobalDir() {
	var globalPrefix;
	if (process.env.PREFIX) {
	   globalPrefix = process.env.PREFIX;
	} else if (process.platform === 'win32') {
	   globalPrefix = path.dirname(process.execPath);
	} else {
	   globalPrefix = path.dirname(path.dirname(process.execPath));
{'fraction_non_alphanumeric': 0.1679888007466169, 'fraction_numerical': 0.004666355576294913, 'mean_word_length': 5.305882352941176, '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': '212950', 'n_tokens_mistral': 720, 'n_tokens_neox': 711, 'n_words': 134}