<commit_before>var exec = require('cordova/exec'),
    cordova = require('cordova');

var NetworkConnection = function () {
        this.type = null;
        this._firstRun = true;
        this._timer = null;
        this.timeout = 500;

        var me = this,
            channel = require('cordova/channel');

        this.getInfo(
            function (info) {
                me.type = info;
                if (info === "none") {
                    // set a timer if still offline at the end of timer send the offline event
                    me._timer = setTimeout(function(){
                        me.type = type;
                        cordova.fireWindowEvent("offline");
                        me._timer = null;
                        }, me.timeout);
                } else {
                    // If there is a current offline event pending clear it
                    if (me._timer !== null) {
                        clearTimeout(me._timer);
                        me._timer = null;
                    }
                    cordova.fireWindowEvent("online");
                }

                // should only fire this once
                if (me._firstRun) {
                    me._firstRun = false;
                    channel.onCordovaConnectionReady.fire();
                }
            },
            function (e) {
                // If we can't get the network info we should still tell Cordova
                // to fire the deviceready event.
                if (me._firstRun) {
                    me._firstRun = false;
                    channel.onCordovaConnectionReady.fire();
                }
                console.log("Error initializing Network Connection: " + e);
            });
};<commit_msg>Remove extraneous line from network.js<commit_after>var exec = require('cordova/exec'),
    cordova = require('cordova');

var NetworkConnection = function () {
        this.type = null;
        this._firstRun = true;
        this._timer = null;
        this.timeout = 500;

        var me = this,
            channel = require('cordova/channel');

        this.getInfo(
            function (info) {
                me.type = info;
                if (info === "none") {
                    // set a timer if still offline at the end of timer send the offline event
                    me._timer = setTimeout(function(){
                        cordova.fireWindowEvent("offline");
                        me._timer = null;
                        }, me.timeout);
                } else {
                    // If there is a current offline event pending clear it
                    if (me._timer !== null) {
                        clearTimeout(me._timer);
                        me._timer = null;
                    }
                    cordova.fireWindowEvent("online");
                }

                // should only fire this once
                if (me._firstRun) {
                    me._firstRun = false;
                    channel.onCordovaConnectionReady.fire();
                }
            },
            function (e) {
                // If we can't get the network info we should still tell Cordova
                // to fire the deviceready event.
                if (me._firstRun) {
                    me._firstRun = false;
                    channel.onCordovaConnectionReady.fire();
                }
                console.log("Error initializing Network Connection: " + e);
            });
};
{'fraction_non_alphanumeric': 0.09177489177489177, 'fraction_numerical': 0.0017316017316017316, 'mean_word_length': 1.0904704463208685, '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': '314839', 'n_tokens_mistral': 843, 'n_tokens_neox': 765, 'n_words': 220}