<commit_before>"use strict";
var _demo = "\n" +
"\nwindow.demo = function(message, callback) {" +
"\n  if (typeof callback !== 'function')" +
"\n    throw new Error('bad callback: ' + callback);" +
"\n  info(message + ' (waiting 1s)');" +
"\n  setTimeout(function() {" +
"\n    info(message + ' (done!)');" +
"\n    callback(null, message.length);" +
"\n  }, 1000);" +
"\n}" +
"\n";

var _samples = {
	introSample: "" +
	"// Demonstrates how 'streamline.js' transforms synchronous-looking code" +
	"\n// into asynchronous code with callbacks." +
	"\n//" +
	"\n// Try one of the samples above, or write your own code below." +
	"\n// Syntax is simple: just use '_' anywhere a callback is expected" +
	"\n//" +
	"\n// The samples compute factorial(4) by different methods." +
	"\n//" +
	"\n// Look at the transformed code and run it with the 'execute' button." +
	//"\n//" +
	//"\n// The 'beautify' button can help you tidy your code." +
	_demo +
	"\ndemo('Straight to the answer: fact(4) = 24', _);" +
	"\n" +
	"\n// A few pointers to understand the generated code:" +
	"\n//" +
	"\n// * the '_' parameter is the callback. This is where execution will" +
	"\n//   continue on a return or throw statement." +
	"\n// * the '__then' variable is a 'then' callback. This is where execution will" +
	"\n//   resume at the end of the construct if it didn't encounter a return " +
	"\n//   or throw." +
	"\n// * the '__cb' function is just a little callback wrapper that deals with " +
	"\n//   error handling and other small matters in a generic way." +
	"\n// * the '__trap' function handles errors if the callback is missing." +
	"\n",

	sequenceSample: "" +
	"// Multiply one step at a time:" +
	"\n" +
	"\nvar fact = demo('1', _);" +
	"\nfact *= demo('12', _);" +
	"\nfact *= demo('123', _);" +
	"\nfact *= demo('1234', _);" +
	"\ndemo('fact(4) = ' + fact, _);" +
	"\n",

	expressionsSample: "" +
	"// Multiply all at once:" +
	"\n" +
	"\nvar fact = demo('1', _) * demo('12', _) * demo('123', _) * demo('1234', _);" +
	"\ndemo('fact(4) = ' + fact, _)" +
	"\n",

	functionsSample: "" +
	"// Go through intermediate functions: " +<commit_msg>removed obsolete text in interactive demo<commit_after>"use strict";
var _demo = "\n" +
"\nwindow.demo = function(message, callback) {" +
"\n  if (typeof callback !== 'function')" +
"\n    throw new Error('bad callback: ' + callback);" +
"\n  info(message + ' (waiting 1s)');" +
"\n  setTimeout(function() {" +
"\n    info(message + ' (done!)');" +
"\n    callback(null, message.length);" +
"\n  }, 1000);" +
"\n}" +
"\n";

var _samples = {
	introSample: "" +
	"// Demonstrates how 'streamline.js' transforms synchronous-looking code" +
	"\n// into asynchronous code with callbacks." +
	"\n//" +
	"\n// Try one of the samples above, or write your own code below." +
	"\n// Syntax is simple: just use '_' anywhere a callback is expected" +
	"\n//" +
	"\n// The samples compute factorial(4) by different methods." +
	"\n//" +
	"\n// Look at the transformed code and run it with the 'execute' button." +
	//"\n//" +
	//"\n// The 'beautify' button can help you tidy your code." +
	_demo +
	"\ndemo('Straight to the answer: fact(4) = 24', _);" +
	"\n",

	sequenceSample: "" +
	"// Multiply one step at a time:" +
	"\n" +
	"\nvar fact = demo('1', _);" +
	"\nfact *= demo('12', _);" +
	"\nfact *= demo('123', _);" +
	"\nfact *= demo('1234', _);" +
	"\ndemo('fact(4) = ' + fact, _);" +
	"\n",

	expressionsSample: "" +
	"// Multiply all at once:" +
	"\n" +
	"\nvar fact = demo('1', _) * demo('12', _) * demo('123', _) * demo('1234', _);" +
	"\ndemo('fact(4) = ' + fact, _)" +
	"\n",

	functionsSample: "" +
	"// Go through intermediate functions: " +
{'fraction_non_alphanumeric': 0.22131593257205004, 'fraction_numerical': 0.016856987493202826, 'mean_word_length': 3.0295728368017523, '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': '1770709', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1316, 'n_words': 414}