<commit_before>/*
 * heartbeat
 * https://github.com/jnelson/heartbeat
 *
 * Copyright (c) 2012 johnymonster
 * Licensed under the MIT, GPL licenses.
 */

var HeartBeat = {};

(function($, window) {

    HeartBeat = function(options) {
        var self = this;
        this.options = $.extend(true,{},this._options,options);

        if(this.options.type === 'ga') {
            window._gaq = window._gaq || [];
        }
        this.init();
        if(this.options.autostart === true) {
            this.start();
        }
    };

    HeartBeat.prototype = {
        _options : {
            autostart : false,
            interval : 10000,
            type : 'ga'
        },
        types : {
            ga : {
                beat : function(arr) {
                    window._gaq.push(arr);
                }
            }
        },
        init : function() {
            if(typeof this.types[this.options.type] !== 'undefined') {
                this.options.event = this.types[this.options.type];
            }
        },
        start : function() {
            var self = this;
            if(this.event() !== false) {
                this.int = window.setInterval(function(){
                    self.event.apply(self,null);<commit_msg>Only set predefined event function if options.event is not set.<commit_after>/*
 * heartbeat
 * https://github.com/jnelson/heartbeat
 *
 * Copyright (c) 2012 johnymonster
 * Licensed under the MIT, GPL licenses.
 */

var HeartBeat = {};

(function($, window) {

    HeartBeat = function(options) {
        var self = this;
        this.options = $.extend(true,{},this._options,options);

        if(this.options.type === 'ga') {
            window._gaq = window._gaq || [];
        }
        this.init();
        if(this.options.autostart === true) {
            this.start();
        }
    };

    HeartBeat.prototype = {
        _options : {
            autostart : false,
            interval : 10000,
            type : 'ga'
        },
        types : {
            ga : {
                beat : function(arr) {
                    window._gaq.push(arr);
                }
            }
        },
        init : function() {
            if(typeof this.types[this.options.type] !== 'undefined' && typeof this.options.event === 'undefined') {
                this.options.event = this.types[this.options.type];
            }
        },
        start : function() {
            var self = this;
            if(this.event() !== false) {
                this.int = window.setInterval(function(){
                    self.event.apply(self,null);
{'fraction_non_alphanumeric': 0.1407635942923255, 'fraction_numerical': 0.006941766293868106, 'mean_word_length': 1.449480642115203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3257494', 'n_tokens_mistral': 760, 'n_tokens_neox': 710, 'n_words': 135}