<commit_before>(function($){

	var MyDice = function(element, options) {

		var elem = $(element);
		var obj = this;

		// Merge options with defaults
		var settings = $.extend({
			number 		: 6, // Number of sides for the dice
			speed		: 100, // Speed of dice roll
			duration 	: 2000, // Duration of dice roll
			callBack 	: function() {} // Callback function for when roll has finished
		}, options || {});

		// Public method
		this.rollDice = function() {

			var myNumbers = [];

			// Lets create an array of numbers from our number setting
			for (var i = 1; i <= settings.number; i++) {
				myNumbers.push(i);
			};

			if ( myNumbers.length > 0 ) {
				// We have some numbers to roll on our dice
			} else {

				if (typeof console == "object" ) { 
					console.log('We have no numbers to roll');
				}				
				return false;

			}

			// If we have got this far, we need to roll the dice
			var myInterval = setInterval(function () {
				var chosen = myNumbers[Math.floor(Math.random()*myNumbers.length)];
				elem.text(chosen);
			}, settings.speed);

			setTimeout(function(){
				var finalChoice = myNumbers[Math.floor(Math.random()*myNumbers.length)];
				elem.text(finalChoice);
				window.clearInterval(myInterval);
				settings.callBack.call(this);
			}, settings.duration);

			

	    };
	};

	$.fn.rsDice = function(options) {

		return this.each(function() {
	 
           	var myDice = new MyDice(this, options);
           	myDice.rollDice();

       	});

	}

}(jQuery));<commit_msg>check to see callBack is function<commit_after>(function($){

	var MyDice = function(element, options) {

		var elem = $(element);
		var obj = this;

		// Merge options with defaults
		var settings = $.extend({
			number 		: 6, // Number of sides for the dice
			speed		: 100, // Speed of dice roll
			duration 	: 2000, // Duration of dice roll
			callBack 	: function() {} // Callback function for when roll has finished
		}, options || {});

		// Public method
		this.rollDice = function() {

			var myNumbers = [];

			// Lets create an array of numbers from our number setting
			for (var i = 1; i <= settings.number; i++) {
				myNumbers.push(i);
			};

			if ( myNumbers.length > 0 ) {
				// We have some numbers to roll on our dice
			} else {

				if (typeof console == "object" ) { 
					console.log('We have no numbers to roll');
				}				
				return false;

			}

			// If we have got this far, we need to roll the dice
			var myInterval = setInterval(function () {
				var chosen = myNumbers[Math.floor(Math.random()*myNumbers.length)];
				elem.text(chosen);
			}, settings.speed);

			setTimeout(function(){
				var finalChoice = myNumbers[Math.floor(Math.random()*myNumbers.length)];
				elem.text(finalChoice);
				window.clearInterval(myInterval);

				if ( $.isFunction( settings.callBack ) ) {
					settings.callBack.call(obj);
				}
				
			}, settings.duration);

			

	    };
	};

	$.fn.rsDice = function(options) {

		return this.each(function() {
	 
           	var myDice = new MyDice(this, options);
           	myDice.rollDice();

       	});

	}

}(jQuery));
{'fraction_non_alphanumeric': 0.13602584814216478, 'fraction_numerical': 0.006462035541195477, 'mean_word_length': 2.5463917525773194, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1627886', 'n_tokens_mistral': 1210, 'n_tokens_neox': 949, 'n_words': 279}