<commit_before>Object {
	property string type: "GET";
	property string name;
	property string path;

	function call(api, args) {
		var nargs = this.args.length
		if (args.length < nargs + 2)
			throw new Error("not enough arguments for method " + this.name)
		nargs = args.length - 2

		var argsargs 	= Array.prototype.slice.call(args, 0, nargs)
		var data 		= this.args.apply(this, argsargs)
		var callback 	= args[nargs + 0]
		var error 		= args[nargs + 1]
		var headers 	= {}
		var newHeaders  = this.headers(headers)
		if (newHeaders !== undefined)
			headers = newHeaders

		api.call(this.path, callback, error, this.type, data, headers)
	}

	function headers(headers) {
	}

	function args() {
	}

	onNameChanged: {
		this.parent._registerMethod(this.name, this)
	}
}
<commit_msg>allow path modification using {var} syntax<commit_after>Object {
	property string type: "GET";
	property string name;
	property string path;

	function call(api, args) {
		var nargs = this.args.length
		if (args.length < nargs + 2)
			throw new Error("not enough arguments for method " + this.name)
		nargs = args.length - 2

		var argsargs 	= Array.prototype.slice.call(args, 0, nargs)
		var data 		= this.args.apply(this, argsargs)
		var callback 	= args[nargs + 0]
		var error 		= args[nargs + 1]
		var headers 	= {}
		var newHeaders  = this.headers(headers)
		if (newHeaders !== undefined)
			headers = newHeaders
		var path = this.pathArgs(this.path, argsargs)

		api.call(path, callback, error, this.type, data, headers)
	}

	function headers(headers) {
	}

	function args() {
	}

	function pathArgs(path, args) {
		var path = this.path
		var re = /\{(\w+)\}/g
		var index = 0
		path = path.replace(re, function(m) {
			return (index < args.length)? args[index++]: ''
		})

		return path
	}

	onNameChanged: {
		this.parent._registerMethod(this.name, this)
	}
}

{'fraction_non_alphanumeric': 0.1279007015650297, 'fraction_numerical': 0.0059363194819212085, 'mean_word_length': 3.4354066985645932, 'pattern_counts': {'":': 0, '<': 6, '<?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': '2052750', 'n_tokens_mistral': 712, 'n_tokens_neox': 641, 'n_words': 174}