<commit_before>( function ( $, WL ) {

	var API = function () {}, path = '', dataType = '', deferred = $.Deferred();
	API.prototype.request = function ( data, o ) {
		o = o || {};
		path = o.path || '/w/api.php';
		dataType = o.dataType || 'jsonp';
		data.format = o.format || 'json';
		$.ajax(
			'//' + WL.mediawiki.host + path,
			{
				dataType: dataType,
				data: data
			}
		).done( function ( doc, status, jqXHR ) {
			if ( !doc.error ) {
				if ( doc.warnings ) {
					console.warn( doc.warnings );
				}
				deferred.resolve( doc );
			} else {
				console.error( doc.error );
				deferred.reject( doc.error );
			}
		} ).fail( function ( jqXHR, status, err ) {
			var errorData = { code: status, message: err };
			console.error( errorData );
			deferred.reject( errorData );
		} );
<commit_msg>Fixes scope for vars in API.request()<commit_after>( function ( $, WL ) {

	var API = function () {}
	API.prototype.request = function ( data, o ) {
		o = o || {};
		var path = '', dataType = '', deferred = $.Deferred();
		path = o.path || '/w/api.php';
		dataType = o.dataType || 'jsonp';
		data.format = o.format || 'json';
		$.ajax(
			'//' + WL.mediawiki.host + path,
			{
				dataType: dataType,
				data: data
			}
		).done( function ( doc, status, jqXHR ) {
			if ( !doc.error ) {
				if ( doc.warnings ) {
					console.warn( doc.warnings );
				}
				deferred.resolve( doc );
			} else {
				console.error( doc.error );
				deferred.reject( doc.error );
			}
		} ).fail( function ( jqXHR, status, err ) {
			var errorData = { code: status, message: err };
			console.error( errorData );
			deferred.reject( errorData );
		} );

{'fraction_non_alphanumeric': 0.18525289457647776, 'fraction_numerical': 0.0, 'mean_word_length': 2.4936170212765956, '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': '657', 'n_tokens_mistral': 692, 'n_tokens_neox': 580, 'n_words': 136}