<commit_before>'use strict';

var spawn = require('child-process-promise').spawn;
var quote = require('quote');
var Q = require('q');
var E = require('linq');
var SshClient = require('ssh-promise');
var fs = require('fs');
var assert = require('chai').assert;
var Mustache = require('Mustache');
var util = require('util');

var Azure = function (config) {

	assert.isObject(this);

	if (!config) {
		config = {};
	}
	else {
		assert.isObject(config);
	}

	var self = this;
	var verbose = config.verbose;

	//
	// Run an Azure command, return a promise.
	//
	self.runAzureCmd = function (args) {

		assert.isArray(args);
		assert(args.length > 0);

		var azureCmd = 'azure';

		var spawnOptions = {
			capture: [
				'stdout',
				'stderr',
			],
		};

		if (verbose) {
			console.log('Invoking command: "' + azureCmd + ' ' + args.map(function (arg) { return quote(arg); }).join(' ') + '"');
		}

		return spawn(azureCmd, args, spawnOptions)
			.then(function (output) {
				if (verbose) {
					console.log(output.stdout);
					console.log(output.stderr);
				}
				return output;
			})
			.catch(function (err) {
				if (verbose) {
					console.log(err.stdout);
					console.log(err.stderr);
				}
				throw err;
			});
	};

	//
	// Create an Azure cluster storage
	//
	self.createClusterStorage  = function (containerName) {

		if (verbose) {
			console.log('Creating network: ' + networkName);
		}

		var args = [
			'storage',
			'create',
			containerName
		];

		return self.runAzureCmd(args);
	};



	//
	// Create an Azure Cluster with an existing storage.
	//
	self.createCluster = function (clOptions) {

		assert.isObject(clOptions);

		assert.isString(clOptions.storageContainer);
		assert.isString(clOptions.password);
		assert.isString(clOptions.sshPassword);
		assert.isString(clOptions.sshUserName);
		assert.isString(clOptions.clusterName);
		assert.isString(clOptions.storageAccountName);<commit_msg>Fixing typo<commit_after>'use strict';

var spawn = require('child-process-promise').spawn;
var quote = require('quote');
var Q = require('q');
var E = require('linq');
var SshClient = require('ssh-promise');
var fs = require('fs');
var assert = require('chai').assert;
var Mustache = require('Mustache');
var util = require('util');

var Azure = function (config) {

	assert.isObject(this);

	if (!config) {
		config = {};
	}
	else {
		assert.isObject(config);
	}

	var self = this;
	var verbose = config.verbose;

	//
	// Run an Azure command, return a promise.
	//
	self.runAzureCmd = function (args) {

		assert.isArray(args);
		assert(args.length > 0);

		var azureCmd = 'azure';

		var spawnOptions = {
			capture: [
				'stdout',
				'stderr',
			],
		};

		if (verbose) {
			console.log('Invoking command: "' + azureCmd + ' ' + args.map(function (arg) { return quote(arg); }).join(' ') + '"');
		}

		return spawn(azureCmd, args, spawnOptions)
			.then(function (output) {
				if (verbose) {
					console.log(output.stdout);
					console.log(output.stderr);
				}
				return output;
			})
			.catch(function (err) {
				if (verbose) {
					console.log(err.stdout);
					console.log(err.stderr);
				}
				throw err;
			});
	};

	//
	// Create an Azure cluster storage
	//
	self.createClusterStorage  = function (containerName) {

		if (verbose) {
			console.log('Creating network: ' + containerName);
		}

		var args = [
			'storage',
			'create',
			containerName
		];

		return self.runAzureCmd(args);
	};



	//
	// Create an Azure Cluster with an existing storage.
	//
	self.createCluster = function (clOptions) {

		assert.isObject(clOptions);

		assert.isString(clOptions.storageContainer);
		assert.isString(clOptions.password);
		assert.isString(clOptions.sshPassword);
		assert.isString(clOptions.sshUserName);
		assert.isString(clOptions.clusterName);
		assert.isString(clOptions.storageAccountName);
{'fraction_non_alphanumeric': 0.15901981230448384, 'fraction_numerical': 0.0005213764337851929, 'mean_word_length': 3.4002293577981653, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2913269', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1267, 'n_words': 268}