<commit_before>/*global console, process, require*/
( function () {


        //SHOULD HANDLE FATAL DB ERRORS HERE! -> try a connection, then close!
        'use strict';
        let fs = require( 'fs' );
        let spawn = require( 'child_process' ).spawn;

        let numberOfRetrys = 5; //The number of times any service should be restarted before full termination.
        let retryInterval = 60000; //The interval between a crash and then a retry
        let config;
        let server, scanner, phantomjs; //THe processes.



        function initiateServer() {
          server = require('./lib/server.js');

          server.on('change', function(e){
              console.log(e);
          });

          server.on('error', function(err){
              console.log(err);
          });

          server.listen(1337);

        }

        function initiateProximityScanner() {

        }

        function initiatiePhantomJS() {
            phantomjs = spawn( 'phantomjs', [ '--web-security=no', '/scripts/phantom-pi-ws.js', JSON.stringify( config ) ] );

            phantomjs.stdout.on( 'data', function ( data ) {
                let msg = data.toString();
                console.log( msg );
            } );

            phantomjs.stderr.on( 'data', function ( data ) {
                let err = data.toString();
                console.log( err );
            } );

            phantomjs.on( 'error', function ( err ) {
                console.log( err );
            } );

            phantomjs.on( 'close', function ( code ) {
                console.log( "closed with code " + code );
            } );
        }

        function terminate() {
            //SEND KILL TO ALL THE PROCESSES.
            //LOG TO /boot/webstrate-pi-error.log
            //process.exit(1);
        }




    }

}() );<commit_msg>added code to test on PI<commit_after>/*global console, process, require*/
( function () {


        //SHOULD HANDLE FATAL DB ERRORS HERE! -> try a connection, then close!
        'use strict';
        let fs = require( 'fs' );
        let spawn = require( 'child_process' ).spawn;

        let numberOfRetrys = 5; //The number of times any service should be restarted before full termination.
        let retryInterval = 60000; //The interval between a crash and then a retry
        let config;
        let server, scanner, phantomjs; //THe processes.



        function initiateServer() {
          server = require('./lib/server.js');

          server.on('change', function(e){
              console.log(e);
          });

          server.on('error', function(err){
              console.log(err);
          });

          server.listen(1337);

        }

        function initiateProximityScanner() {

        }

        function initiatiePhantomJS() {
            phantomjs = spawn( 'phantomjs', [ '--web-security=no', '/scripts/phantom-pi-ws.js', JSON.stringify( config ) ] );

            phantomjs.stdout.on( 'data', function ( data ) {
                let msg = data.toString();
                console.log( msg );
            } );

            phantomjs.stderr.on( 'data', function ( data ) {
                let err = data.toString();
                console.log( err );
            } );

            phantomjs.on( 'error', function ( err ) {
                console.log( err );
            } );

            phantomjs.on( 'close', function ( code ) {
                console.log( "closed with code " + code );
            } );
        }
}());
{'fraction_non_alphanumeric': 0.1293746414228342, 'fraction_numerical': 0.006024096385542169, 'mean_word_length': 1.558327219369039, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7271622', 'n_tokens_mistral': 1020, 'n_tokens_neox': 907, 'n_words': 251}