<commit_before>/*
Author: <NAME>
Company: Huddle
Last updated date: 26 Feb 2014
URL: https://github.com/Huddle/PhantomFlow
*/

var casper;
var tree = {};
var cStep;
var pathCount;
var doneSteps;

var hasFailure;
var hasTest;
var casperAssert;
var jsonRoot;

var libraryRoot;

var currentFlowName;

exports.init = init;
exports.listen = listen;
exports.updateJsonRoot = updateJsonRoot;

function listen( event, callback ) {
	casper.on( 'phantomflow.' + event, callback );
	return this;
}

function patchTester( casper ) {
	var patchedTester = require( libraryRoot + '/casperjs-modified-tester.js' );

	casper.__defineGetter__( 'test', function () {
		if ( !this._test ) {
			this._test = patchedTester.create( this );
		}
		return this._test;
	} );

	casperAssert = casper.test.assert;

	listen( 'step.begin', disableAsserts );
	listen( 'step.end', enableAsserts );
}

function init( options ) {
	casper = options.casper;
	jsonRoot = options.dataRoot || './flowData';

	libraryRoot = options.libraryRoot || '.';

	patchTester( casper );

	casper.test.on( 'fail', onCasperFail );
	casper.test.on( 'success', onCasperSuccess );

	listen( 'flow.begin', getCurrentFlowName );
	listen( 'flow.end', writeJson );
	listen( 'uniqueStep.begin', onUniqueStepBegin );
	listen( 'uniqueStep.end', onUniqueStepEnd );

	var obj = options.scope || {};
	return extend( obj );
}

function fileNameGetter( root, fileName ) {
	var file = root + flowPathName;

	screenshotPath = './screenshots/' + flowPathName + '.png';

	if ( !fs.isFile( file + '.png' ) ) {
		return file + '.png';
	} else {
		return file + '.diff.png';
	}
}

function disableScreenshots() {
	css.screenshot = function () {};
}

function enableScreenshots() {
	css.screenshot = css_screenshot;
}<commit_msg>Removed dead code.<commit_after>/*
Author: <NAME>
Company: Huddle
Last updated date: 26 Feb 2014
URL: https://github.com/Huddle/PhantomFlow
*/

var casper;
var tree = {};
var cStep;
var pathCount;
var doneSteps;

var hasFailure;
var hasTest;
var casperAssert;
var jsonRoot;

var libraryRoot;

var currentFlowName;

exports.init = init;
exports.listen = listen;
exports.updateJsonRoot = updateJsonRoot;

function listen( event, callback ) {
	casper.on( 'phantomflow.' + event, callback );
	return this;
}

function patchTester( casper ) {
	var patchedTester = require( libraryRoot + '/casperjs-modified-tester.js' );

	casper.__defineGetter__( 'test', function () {
		if ( !this._test ) {
			this._test = patchedTester.create( this );
		}
		return this._test;
	} );

	casperAssert = casper.test.assert;

	listen( 'step.begin', disableAsserts );
	listen( 'step.end', enableAsserts );
}

function init( options ) {
	casper = options.casper;
	jsonRoot = options.dataRoot || './flowData';

	libraryRoot = options.libraryRoot || '.';

	patchTester( casper );

	casper.test.on( 'fail', onCasperFail );
	casper.test.on( 'success', onCasperSuccess );

	listen( 'flow.begin', getCurrentFlowName );
	listen( 'flow.end', writeJson );
	listen( 'uniqueStep.begin', onUniqueStepBegin );
	listen( 'uniqueStep.end', onUniqueStepEnd );

	var obj = options.scope || {};
	return extend( obj );
}
{'fraction_non_alphanumeric': 0.14578005115089515, 'fraction_numerical': 0.0038363171355498722, 'mean_word_length': 4.376288659793815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3261055', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1062, 'n_words': 259}