<commit_before>var LastFM = function() {
	this.api_key = "<KEY>";
	this.api_secret = "bd6d6f4fd70d3e6696da309c26123329";
	this.session_key = '';

	this.base_params = {"api_key": this.api_key};
	this.base_url = "http://ws.audioscrobbler.com/2.0/";

	this.get_default_params = function() { return {"api_key": this.api_key}; };
};

LastFM.prototype._sign = function(params) {
	var sortedKeys = Object.keys(params).sort();
	var stringToSign = "";
	for (var i = 0; i < sortedKeys.length; ++i)
	{
		stringToSign += sortedKeys[i];
		stringToSign += params[sortedKeys[i]];
	}
	stringToSign += this.api_secret;

	var hash = md5(stringToSign);

	params["api_sig"] = hash;

	return hash;
}

LastFM.prototype.trackGetInfo = function(track, artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "track.getInfo";
	params["track"] = track;
	params["artist"] = artist;
	this._sign(params);
	params["format"] = "json";

	$.get(this.base_url, params, callback);
}

LastFM.prototype.albumGetInfo = function(album, artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "album.getInfo";
	params["album"] = artist;
	params["artist"] = artist;
	params["autocorrect"] = "1";
	this._sign(params);
	params["format"] = "json";

	$.get(this.base_url, params, callback);
}

LastFM.prototype.artistGetInfo = function(artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "artist.getInfo";
	params["artist"] = artist;
	params["autocorrect"] = "1";
	this._sign(params);
	params["format"] = "json";

	$.get(this.base_url, params, callback);
}

LastFM.prototype.trackGetCorrection = function(track, artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "track.getCorrection";
	params["track"] = track;
	params["artist"] = artist;
	this._sign(params);
	params["format"] = "json";

	$.get(this.base_url, params, callback);
}

LastFM.prototype.authGetSession = function(token, callback) {
	callback = callback || console.log;

	var params = this.get_default_params();
	params["token"] = token;
	params["method"] = "auth.getsession";
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params
	}).success((function(data) {
		if (data.session) {
			this.session_key = data.session.key;
			callback(data);
		}
	}).bind(this));
}

LastFM.prototype.userGetInfo = function(callback, user) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "user.getInfo";
	params["sk"] = this.session_key;
	if (user) {
		params["user"] = user;
	}
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params
	}).always(callback);
}

LastFM.prototype.trackScrobble = function(track, artist, callback) {
	callback = callback || console.log;

	var params = this.get_default_params();
	params["sk"] = this.session_key;
	params["method"] = "track.scrobble";
	params["track"] = track;
	params["artist"] = artist;
	params["timestamp"] = Math.floor(Date.now() / 1000);
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params,
		method: 'POST',
	}).always(callback);
}

LastFM.prototype.trackNowPlaying = function(track, artist, callback) {
	callback = callback || function(data) { console.log(data) };

	var params = this.get_default_params();
	params["method"] = "track.updateNowPlaying";
	params["artist"] = artist;
	params["track"] = track;
	params["duration"] = 300;
	params["sk"] = this.session_key;

	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params,
		method: 'POST',
	}).always(callback);
}<commit_msg>Change the ajax calls to always call the callback<commit_after>var LastFM = function() {
	this.api_key = "<KEY>";
	this.api_secret = "bd6d6f4fd70d3e6696da309c26123329";
	this.session_key = '';

	this.base_params = {"api_key": this.api_key};
	this.base_url = "http://ws.audioscrobbler.com/2.0/";

	this.get_default_params = function() { return {"api_key": this.api_key}; };
};

LastFM.prototype._sign = function(params) {
	var sortedKeys = Object.keys(params).sort();
	var stringToSign = "";
	for (var i = 0; i < sortedKeys.length; ++i)
	{
		stringToSign += sortedKeys[i];
		stringToSign += params[sortedKeys[i]];
	}
	stringToSign += this.api_secret;

	var hash = md5(stringToSign);

	params["api_sig"] = hash;

	return hash;
}

LastFM.prototype.trackGetInfo = function(track, artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "track.getInfo";
	params["track"] = track;
	params["artist"] = artist;
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params,
	}).always(callback);
}

LastFM.prototype.albumGetInfo = function(album, artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "album.getInfo";
	params["album"] = artist;
	params["artist"] = artist;
	params["autocorrect"] = "1";
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params,
	}).always(callback);
}

LastFM.prototype.artistGetInfo = function(artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "artist.getInfo";
	params["artist"] = artist;
	params["autocorrect"] = "1";
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params,
	}).always(callback);
}

LastFM.prototype.trackGetCorrection = function(track, artist, callback) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "track.getCorrection";
	params["track"] = track;
	params["artist"] = artist;
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params,
	}).always(callback);
}

LastFM.prototype.authGetSession = function(token, callback) {
	callback = callback || console.log;

	var params = this.get_default_params();
	params["token"] = token;
	params["method"] = "auth.getsession";
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params
	}).success((function(data) {
		if (data.session) {
			this.session_key = data.session.key;
		}
	}).bind(this)).always(callback);
}

LastFM.prototype.userGetInfo = function(callback, user) {
	callback = callback || console.log;
	var params = this.get_default_params();
	params["method"] = "user.getInfo";
	params["sk"] = this.session_key;
	if (user) {
		params["user"] = user;
	}
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		url: this.base_url,
		data: params
	}).always(callback);
}

LastFM.prototype.trackScrobble = function(track, artist, callback) {
	callback = callback || console.log;

	var params = this.get_default_params();
	params["sk"] = this.session_key;
	params["method"] = "track.scrobble";
	params["track"] = track;
	params["artist"] = artist;
	params["timestamp"] = Math.floor(Date.now() / 1000);
	this._sign(params);
	params["format"] = "json";

	$.ajax({
		method: 'POST',
		url: this.base_url,
		data: params,
	}).always(callback);
}

LastFM.prototype.trackNowPlaying = function(track, artist, callback) {
	callback = callback || function(data) { console.log(data) };

	var params = this.get_default_params();
	params["method"] = "track.updateNowPlaying";
	params["artist"] = artist;
	params["track"] = track;
	params["duration"] = 300;
	params["sk"] = this.session_key;

	this._sign(params);
	params["format"] = "json";

	$.ajax({
		method: 'POST',
		url: this.base_url,
		data: params,
	}).always(callback);
}
{'fraction_non_alphanumeric': 0.1837837837837838, 'fraction_numerical': 0.008751608751608752, 'mean_word_length': 5.042768273716952, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 5, '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': '6239215', 'n_tokens_mistral': 2848, 'n_tokens_neox': 2725, 'n_words': 523}