<commit_before>'use strict';

var execFile = require('child_process').execFile;

module.exports = function (cb) {
	var cmd;
	var args;
	var ret;

	if (process.platform === 'darwin') {
		cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport';
		args = ['-I'];
	} else if (process.platform === 'linux') {
		cmd = 'nmcli';
		args = ['-t', '-f', 'active,ssid', 'dev', 'wifi'];
	} else if (process.platform === 'win32') {
		cmd = 'netsh';
		args = ['wlan', 'show', 'interface'];
	} else {
		throw new Error('Only OS X, Linux and Windows systems are supported');
	}

	execFile(cmd, args, function (err, stdout) {
		if (err) {
			cb(err);
			return;
		}

		if (stdout && process.platform === 'darwin') {
			ret = /^\s*SSID: (.+)\s*$/gm.exec(stdout);
			ret = ret && ret.length ? ret[1] : null;
		}

		if (stdout && process.platform === 'linux') {
			ret = /^\s*yes:(.+)\s*$/gm.exec(stdout);
			ret = ret && ret.length ? ret[1].slice(1, ret[1].length - 1) : null;
		}

		if (stdout && process.platform === 'win32') {
			ret = /^\s*SSID\s*: (.+)\s*$/gm.exec(stdout);
			ret = ret && ret.length ? ret[1] : null;
		}

		if (!ret) {
			cb(new Error('Could not get SSID'));
			return;
		}

		cb(null, ret);
	});
};
<commit_msg>Fixes #4 | iwgetid instead of nmcli<commit_after>'use strict';

var execFile = require('child_process').execFile;

module.exports = function (cb) {
	var cmd;
	var args;
	var ret;

	if (process.platform === 'darwin') {
		cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport';
		args = ['-I'];
	} else if (process.platform === 'linux') {
		cmd = 'iwgetid';
		args = ['--raw'];
	} else if (process.platform === 'win32') {
		cmd = 'netsh';
		args = ['wlan', 'show', 'interface'];
	} else {
		throw new Error('Only OS X, Linux and Windows systems are supported');
	}

	execFile(cmd, args, function (err, stdout) {
		if (err) {
			cb(err);
			return;
		}

		if (stdout && process.platform === 'darwin') {
			ret = /^\s*SSID: (.+)\s*$/gm.exec(stdout);
			ret = ret && ret.length ? ret[1] : null;
		}

		if (stdout && process.platform === 'linux') {
			ret = stdout.replace('\n', '');
		}

		if (stdout && process.platform === 'win32') {
			ret = /^\s*SSID\s*: (.+)\s*$/gm.exec(stdout);
			ret = ret && ret.length ? ret[1] : null;
		}

		if (!ret) {
			cb(new Error('Could not get SSID'));
			return;
		}

		cb(null, ret);
	});
};

{'fraction_non_alphanumeric': 0.2198844884488449, 'fraction_numerical': 0.011138613861386138, 'mean_word_length': 3.232111692844677, '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': '3118574', 'n_tokens_mistral': 1025, 'n_tokens_neox': 905, 'n_words': 216}