<commit_before>'use strict';

var winston = require('winston');
var MockScriptStore = require('./mockScriptStore');

var ScriptRunner = function(service,options){
	this.service = service;
	this.options = options || {};
	this.scriptStore = new MockScriptStore();
	this.logger = new (winston.Logger)();
};

ScriptRunner.prototype.run = function(method,script,options,cb){

	// If there is no incoming authentication, use ours
	if(!options.auth){
		options.auth = this.options.auth;
	}

	options.logger = options.logger || this.logger;
	options.scriptStore = options.scriptStore || this.scriptStore;
        options.input = options.input || {};

	return this.service.runMethod(method,script,options,cb);
};


module.exports = ScriptRunner;
<commit_msg>Handle case where no options are sent to scriptRunner.run<commit_after>'use strict';

var winston = require('winston');
var MockScriptStore = require('./mockScriptStore');

var ScriptRunner = function(service,options){
	this.service = service;
	this.options = options || {};
	this.scriptStore = new MockScriptStore();
	this.logger = new (winston.Logger)();
};

ScriptRunner.prototype.run = function(method,script,options,cb){
	options = options || {};
	// If there is no incoming authentication, use ours
	if(!options.auth){
		options.auth = this.options.auth;
	}

	options.logger = options.logger || this.logger;
	options.scriptStore = options.scriptStore || this.scriptStore;
        options.input = options.input || {};

	return this.service.runMethod(method,script,options,cb);
};


module.exports = ScriptRunner;

{'fraction_non_alphanumeric': 0.14231014677728143, 'fraction_numerical': 0.0, 'mean_word_length': 5.007662835249042, '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': '1027026', 'n_tokens_mistral': 466, 'n_tokens_neox': 452, 'n_words': 102}