<commit_before>var instanceConfig = require('./config').getActiveInstanceConfig();
var request = require('request');
var utils = require('./utils');

function Action(actionPath, payload) {
	var actionPathBase = [
		'http://',
		instanceConfig.username + ':',
		instanceConfig.password + '@',
		instanceConfig.host + ':',
		instanceConfig.port + '/api/jsonws'
	].join('');

	this.actionPath = actionPathBase + actionPath;
	this.payload = payload;
}

Action.prototype.doAction = function(callback) {
	var payload = this.payload;

	try {
		if (!payload) {
			throw new Error('Missing payload object');
		}
		if (!callback) {
			throw new Error('Missing callback function');<commit_msg>Use utils to get config and add shebang<commit_after>#!/usr/bin/env node

var request = require('request');
var utils = require('./utils');

var instanceConfig = utils.getConfig().getActiveInstanceConfig();

function Action(actionPath, payload) {
	var actionPathBase = [
		'http://',
		instanceConfig.username + ':',
		instanceConfig.password + '@',
		instanceConfig.host + ':',
		instanceConfig.port + '/api/jsonws'
	].join('');

	this.actionPath = actionPathBase + actionPath;
	this.payload = payload;
}

Action.prototype.doAction = function(callback) {
	var payload = this.payload;

	try {
		if (!payload) {
			throw new Error('Missing payload object');
		}
		if (!callback) {
			throw new Error('Missing callback function');
{'fraction_non_alphanumeric': 0.15460992907801419, 'fraction_numerical': 0.0, 'mean_word_length': 4.55511811023622, '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': '1258932', 'n_tokens_mistral': 447, 'n_tokens_neox': 417, 'n_words': 100}