<commit_before>/**
 ******************************************************************************
 * @file    js/app.js
 * @author  <NAME> (<EMAIL>)
 * @company Particle ( https://www.particle.io/ )
 * @source https://github.com/spark/particle-cli
 * @version V1.0.0
 * @date    27-December-2013
 * @brief   Main program body.
 ******************************************************************************
	Copyright (c) 2016 Particle Industries, Inc.  All rights reserved.

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License as published by the Free Software Foundation, either
	version 3 of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this program; if not, see <http://www.gnu.org/licenses/>.
	******************************************************************************
 */
'use strict';

console.log('Particle Setup is included!');

var path = require('path');
var updateCheck = require('./lib/update-check');
var Interpreter = require('./lib/interpreter.js');
var crypto = require('crypto');

var cli = null;

global.particleEnhancement = {};

global.particleEnhancement.photonSetupFailed = null;
global.particleEnhancement.photonSetupSuccess = null;
global.particleEnhancement.photonNetworkList = null;
global.particleEnhancement.setPhotonNetwork = null;
global.particleEnhancement.photonDeviceId = null;

// TODO: Do photon authentication remotly
global.particleEnhancement.username = '<EMAIL>';
global.particleEnhancement.password = '<PASSWORD>';
global.particleEnhancement.deviceName = crypto.randomBytes(64).toString('hex');


global.particleEnhancement.choosePhotonNetwork = function (networksDetails, __networkChoice) {
	var networks = [];
	for (var key in networksDetails) {
		if (key === 'length' || !networksDetails.hasOwnProperty(key)) {
			continue;
		}
		networks.push(networksDetails[key].ssid);
	}

	global.particleEnhancement.photonNetworkList = networks;<commit_msg>Fix interval bug, add support to claim devices and add more error checks<commit_after>/**
 ******************************************************************************
 * @file    js/app.js
 * @author  <NAME> (<EMAIL>)
 * @company Particle ( https://www.particle.io/ )
 * @source https://github.com/spark/particle-cli
 * @version V1.0.0
 * @date    27-December-2013
 * @brief   Main program body.
 ******************************************************************************
	Copyright (c) 2016 Particle Industries, Inc.  All rights reserved.

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License as published by the Free Software Foundation, either
	version 3 of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this program; if not, see <http://www.gnu.org/licenses/>.
	******************************************************************************
 */
'use strict';

console.log('Particle Setup is included!');

var path = require('path');
var updateCheck = require('./lib/update-check');
var Interpreter = require('./lib/interpreter.js');
var crypto = require('crypto');

var cli = null;

global.particleEnhancement = {};

global.particleEnhancement.photonSetupFailed = null;
global.particleEnhancement.photonSetupSuccess = null;
global.particleEnhancement.photonNetworkList = null;
global.particleEnhancement.setPhotonNetwork = null;
global.particleEnhancement.photonDeviceId = null;

// TODO: Do photon authentication remotly
global.particleEnhancement.username = '';
global.particleEnhancement.password = '';
global.particleEnhancement.deviceName = crypto.randomBytes(64).toString('hex');


global.particleEnhancement.choosePhotonNetwork = function (networksDetails, __networkChoice) {
	var networks = [];
	for (var key in networksDetails) {
		if (key === 'length' || !networksDetails.hasOwnProperty(key)) {
			continue;
		}
		networks.push(networksDetails[key].ssid);
	}

	global.particleEnhancement.photonNetworkList = networks;
{'fraction_non_alphanumeric': 0.1937901498929336, 'fraction_numerical': 0.006852248394004282, 'mean_word_length': 5.389876880984952, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '3573551', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1190, 'n_words': 393}