<commit_before>var Visitor = require('tree-visitor');

module.exports = Transformer;

function Transformer() {}
Transformer.prototype = new Visitor();

Transformer.replaceNode = replaceNode;

Transformer.prototype._visitNodes = function (nodes) {
	for (var i = 0; i < nodes.length; i = replaceNode(ret, i, nodes)) {
		var ret = this._visitNode(nodes[i]);
	}
	return nodes;
};

Transformer.prototype._visitNode = function (node) {
	var ret = Visitor.prototype._visitNode.call(this, node);
	return ret === undefined ? node : ret;
};

function replaceNode(ret, i, nodes) {
	if (ret === null) {<commit_msg>refactor<commit_after>var Visitor = require('tree-visitor');

module.exports = Transformer;

function Transformer() {}
Transformer.prototype = new Visitor();

Transformer.replaceNode = replaceNode;

Transformer.prototype._visitNodes = function (nodes) {
	for (var i = 0; i < nodes.length; i = replaceNode(ret, i, nodes)) {
		var ret = this._visitNode(nodes[i]);
	}
	return nodes;
};

var _visitNode = Visitor.prototype._visitNode;
Transformer.prototype._visitNode = function (node) {
	var ret = _visitNode.call(this, node);
	return ret === undefined ? node : ret;
};

function replaceNode(ret, i, nodes) {
	if (ret === null) {
{'fraction_non_alphanumeric': 0.1449511400651466, 'fraction_numerical': 0.0016286644951140066, 'mean_word_length': 5.054187192118227, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3773813', 'n_tokens_mistral': 398, 'n_tokens_neox': 393, 'n_words': 101}