<commit_before>(function(oCanvas, window, document, undefined){

	// Define the timeline class
	var timeline = function () {
	
		// Return an object when instantiated; this allows the developer to do:
		//     canvas.timeline.start();
		return {
			
			init: function () {
				var _this = this;
				
				// Method for setting the function to be called for each frame
				this.core.setLoop = function (callback) {
					_this.userLoop = callback;
					
					// Return the timeline object to enable methods like start() to be called directly
					return _this;
				};
			},
			
			// Set default values when initalized
			currentFrame: 1,
			timeline: 0,
			running: false,
			
			// Method that will be called for each frame
			loop: function () {
				
				// If mainLoop has been defined
				if (typeof this.userLoop === "function") {
				
					// Clear the canvas if specified
					if (this.core.settings.clearEachFrame === true) {
						this.core.draw.clear();
					}
					
					// Trigger the user defined function mainLoop and set this to the current core instance
					this.userLoop.call(this.core, this.core.canvas);
					
					// Redraw the canvas if specified
					if (this.core.settings.drawEachFrame === true) {
						this.core.draw.redraw();
					}
					
					// Increment the frame count
					this.currentFrame++;
				}
				
				return this;
			},
		
			// Method that starts the timeline
			start: function () {
				var timeline = this;
				
				// Reset the timer
				clearInterval(timeline.timeline);
				timeline.timeline = setInterval(function () { timeline.loop(); }, 1000 / timeline.core.settings.fps);
				timeline.running = true;
				
				return this;
			},
			
			// Method that stops the timeline
			stop: function () {
			
				// Remove the timer<commit_msg>Removed the return value from the internal loop function, since  nothing is requesting the return value.<commit_after>(function(oCanvas, window, document, undefined){

	// Define the timeline class
	var timeline = function () {
	
		// Return an object when instantiated; this allows the developer to do:
		//     canvas.timeline.start();
		return {
			
			init: function () {
				var _this = this;
				
				// Method for setting the function to be called for each frame
				this.core.setLoop = function (callback) {
					_this.userLoop = callback;
					
					// Return the timeline object to enable methods like start() to be called directly
					return _this;
				};
			},
			
			// Set default values when initalized
			currentFrame: 1,
			timeline: 0,
			running: false,
			
			// Method that will be called for each frame
			loop: function () {
				
				// If mainLoop has been defined
				if (typeof this.userLoop === "function") {
				
					// Clear the canvas if specified
					if (this.core.settings.clearEachFrame === true) {
						this.core.draw.clear();
					}
					
					// Trigger the user defined function mainLoop and set this to the current core instance
					this.userLoop.call(this.core, this.core.canvas);
					
					// Redraw the canvas if specified
					if (this.core.settings.drawEachFrame === true) {
						this.core.draw.redraw();
					}
					
					// Increment the frame count
					this.currentFrame++;
				}
			},
		
			// Method that starts the timeline
			start: function () {
				var timeline = this;
				
				// Reset the timer
				clearInterval(timeline.timeline);
				timeline.timeline = setInterval(function () { timeline.loop(); }, 1000 / timeline.core.settings.fps);
				timeline.running = true;
				
				return this;
			},
			
			// Method that stops the timeline
			stop: function () {
			
				// Remove the timer
{'fraction_non_alphanumeric': 0.10052327182594327, 'fraction_numerical': 0.0033048746901679976, 'mean_word_length': 2.280939476061427, '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': '6151642', 'n_tokens_mistral': 1409, 'n_tokens_neox': 982, 'n_words': 340}