<commit_before>define(function (require) {
	var registerSuite = require('intern!object'),
		assert = require('intern/chai!assert'),
		parseQuery = require('../parser').parseQuery,
		Transpiler = require('../transpiler').Transpiler;
	var test = {
		name: 'raddle/test/transpiling'
	};
	var transpiler = new Transpiler();
	function add(key,cb){
		test[key] = function(){
			var dfd = this.async(5000);
			var ready = dfd.callback(cb);
			transpiler.process(key,{
				moduleTextPrefix:"intern/dojo/text!"
			},
			function(error,fn){
				if(error) throw error;
				console.log(fn.toString());
				ready(error,fn);
			});
			return dfd;
		};
	}
	/*add("use(core/string-value-functions),define(get,(string),string,core:concat(file:///,$1,/xml/refs/,$1,.refs.xml)),local:get(.)",function(error,fn){
		var val = "t";
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,"file:///t/xml/refs/t.refs.xml");
	});
	add("use(core/string-regex-functions,core/aggregate-functions),define(depth,(string),number,(tokenize($1,/),count(.))),local:depth(.)",function(error,fn){
		var val = "";
		for(var i=0;i<10;i++){
			val += "/" + Math.random().toString(36).substring(7);
		}
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,11);
	});
	add("use(op/numeric-arithmetic-operators),define(add2,(number,number,number),number,(op:add($1,$2),op:add(.,$3))),local:add2(.,2,3)",function (error, fn) {
		var val = 1;
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,6,'Addition operator should add numbers together');
	});
	add("use(op/numeric-arithmetic-operators,core/higher-order-functions),define(sum,(any*),number,fold-left($1,0,op:add#2)),local:sum(.)",function (error, fn) {
		var val = [];
		for(var i=0;i<10;i++){
			val.push(i);
		}
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,45);
	});
	add("use(op/numeric-arithmetic-operators,op/numeric-comparison-operators,hof/unfold-functions),hof:unfold(.,(op:add(.,1)),(op:greater-than(.,10)))",function (error, fn) {
		var val = 1;
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.deepEqual(ret,[1,2,3,4,5,6,7,8,9,10]);
	});
	*/add("use(op/numeric-arithmetic-operators,op/numeric-comparison-operators,hof/unfold-functions,array/array-functions,map/map-functions,fn/string-value-functions),define(appender,(map,any,(any*)),map,map:transform($1,$2,(array:append(.,$3)))),hof:unfold(.,array:tail#1,array:empty#1,array:head#1,local:appender#3,(array:head(.),string-length(.)),map:new())",function (error, fn) {
		var val = ["sdf","d","we","eq","w"];
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.deepEqual(ret,{1:["d","w"],2:["we","eq"],3:["sdf"]});
	});
	/*add("use(dom/dom-functions),dom:by-id(test)",function (error, fn) {
		var node = document.createElement("div");
		node.id = "test";
		document.body.appendChild(node);
		var val = "";
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.deepEqual(ret,node);
	});
	add("use(dom/dom-functions),core:create(?)",function (error, fn) {
		var val = "div";
		var ret = fn(val);
		console.warn(val,"=>",ret);
	});
	*/
	registerSuite(test);
});
<commit_msg>added js-beautity, dom<commit_after>define(function (require) {
	var registerSuite = require('intern!object'),
		assert = require('intern/chai!assert'),
		parseQuery = require('../parser').parseQuery,
		Transpiler = require('../transpiler').Transpiler,
		js_beautify = require('js-beautify/beautify').js_beautify;
	var test = {
		name: 'raddle/test/transpiling'
	};
	var transpiler = new Transpiler();
	function add(key,cb){
		test[key] = function(){
			var dfd = this.async(5000);
			var ready = dfd.callback(cb);
			transpiler.process(key,{
				moduleTextPrefix:"intern/dojo/text!"
			},
			function(error,fn){
				if(error) throw error;
				console.log(js_beautify(fn.toString()));
				ready(error,fn);
			});
			return dfd;
		};
	}
	/*add("use(fn/string-value-functions),define(get,(string),string,fn:concat(file:///,$1,/xml/refs/,$1,.refs.xml)),local:get(.)",function(error,fn){
		var val = "t";
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,"file:///t/xml/refs/t.refs.xml");
	});
	add("use(fn/string-regex-functions,fn/aggregate-functions),define(depth,(string),number,(tokenize($1,/),count(.))),local:depth(.)",function(error,fn){
		var val = "";
		for(var i=0;i<10;i++){
			val += "/" + Math.random().toString(36).substring(7);
		}
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,11);
	});
	add("use(op/numeric-arithmetic-operators),define(add2,(number,number,number),number,(op:add($1,$2),op:add(.,$3))),local:add2(.,2,3)",function (error, fn) {
		var val = 1;
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,6);
	});
	add("use(op/numeric-arithmetic-operators,fn/higher-order-functions),define(sum,(any*),number,fold-left($1,0,op:add#2)),local:sum(.)",function (error, fn) {
		var val = [];
		for(var i=0;i<10;i++){
			val.push(i);
		}
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.equal(ret,45);
	});
	add("use(op/numeric-arithmetic-operators,op/numeric-comparison-operators,hof/unfold-functions),hof:unfold(.,(op:add(.,1)),(op:greater-than(.,10)))",function (error, fn) {
		var val = 1;
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.deepEqual(ret,[1,2,3,4,5,6,7,8,9,10]);
	});
	add("use(op/numeric-arithmetic-operators,op/numeric-comparison-operators,hof/unfold-functions,array/array-functions,map/map-functions,fn/string-value-functions),define(appender,(map,any,(any*)),map,map:transform($1,$2,(array:append(.,$3)))),hof:unfold(.,array:tail#1,array:empty#1,array:head#1,local:appender#3,(array:head(.),string-length(.)),map:new())",function (error, fn) {
		var val = ["sdf","d","we","eq","w"];
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.deepEqual(ret,{1:["d","w"],2:["we","eq"],3:["sdf"]});
	});*/
	add("use(dom/dom-functions),dom:by-id(test)",function (error, fn) {
		var node = document.createElement("div");
		node.id = "test";
		document.body.appendChild(node);
		var val = "";
		var ret = fn(val);
		console.warn(val,"=>",ret);
		assert.deepEqual(ret,node);
	});
	add("use(dom/dom-functions),dom:element(div,(className:test))",function (error, fn) {
		var val = "div";
		var ret = fn(val);
		console.warn(val,"=>",ret);
	});
	registerSuite(test);
});

{'fraction_non_alphanumeric': 0.24834018337021815, 'fraction_numerical': 0.018020866266202973, 'mean_word_length': 5.63903462749213, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '189029', 'n_tokens_mistral': 2640, 'n_tokens_neox': 2437, 'n_words': 275}