<commit_before>#!/usr/bin/python

#============================ adjust path =====================================

import sys
import os
if __name__ == "__main__":
    here = sys.path[0]
    sys.path.insert(0, os.path.join(here, 'smartmeshsdk-master'))
    sys.path.insert(0, os.path.join(here, '..', 'Sol'))

#============================ imports =========================================

import time
import threading
import json
import random
from   optparse                             import OptionParser

import OpenCli
import basestation_version

# DustThread
from   SmartMeshSDK                         import FormatUtils, \
                                                   HrParser,    \
                                                   sdk_version
from   SmartMeshSDK.IpMgrConnectorSerial    import IpMgrConnectorSerial
from   SmartMeshSDK.IpMgrConnectorMux       import IpMgrConnectorMux, \
                                                   IpMgrSubscribe

# SendThread
import requests

# JsonThread
import bottle
import Sol
import SolVersion
import SolDefines

#============================ defines =========================================

DEFAULT_SERIALPORT           = 'COM14'
DEFAULT_TCPPORT              = 8080
DEFAULT_FILECOMMITDELAY_S    = 60
DEFAULT_SENDCOMMITDELAY_S    = 3
DEFAULT_FILENAME             = 'basestation.sol'
DEFAULT_SERVER               = '127.0.0.1:8080'
DEFAULT_SERVERTOKEN          = 'DEFAULT_SERVERTOKEN'
DEFAULT_SYNCPERIODMINUTES    = 1
DEFAULT_BASESTATIONTOKEN     = 'DEFAULT_BASESTATIONTOKEN'

#============================ helpers =========================================

def printCrash(threadName):
    import traceback
    output  = []
    output += ["CRASH in Thread {0}!".format(threadName)]
    output += [traceback.format_exc()]
    output  = '\n'.join(output)
    print output

#============================ classes =========================================

class Stats(object):
    _instance = None
    _init     = False
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(Stats,cls).__new__(cls, *args, **kwargs)
        return cls._instance
    def __init__(self):
        if self._init:
            return
        self._init    = True
        self.dataLock = threading.RLock()
        self.data     = {}
    def incr(self,statName):
        with self.dataLock:<commit_msg>changing default port<commit_after>#!/usr/bin/python

#============================ adjust path =====================================

import sys
import os
if __name__ == "__main__":
    here = sys.path[0]
    sys.path.insert(0, os.path.join(here, 'smartmeshsdk-master'))
    sys.path.insert(0, os.path.join(here, '..', 'Sol'))

#============================ imports =========================================

import time
import threading
import json
import random
from   optparse                             import OptionParser

import OpenCli
import basestation_version

# DustThread
from   SmartMeshSDK                         import FormatUtils, \
                                                   HrParser,    \
                                                   sdk_version
from   SmartMeshSDK.IpMgrConnectorSerial    import IpMgrConnectorSerial
from   SmartMeshSDK.IpMgrConnectorMux       import IpMgrConnectorMux, \
                                                   IpMgrSubscribe

# SendThread
import requests

# JsonThread
import bottle
import Sol
import SolVersion
import SolDefines

#============================ defines =========================================

DEFAULT_SERIALPORT           = 'COM14'
DEFAULT_TCPPORT              = 8080
DEFAULT_FILECOMMITDELAY_S    = 60
DEFAULT_SENDCOMMITDELAY_S    = 3
DEFAULT_FILENAME             = 'basestation.sol'
DEFAULT_SERVER               = '127.0.0.1:8081'
DEFAULT_SERVERTOKEN          = 'DEFAULT_SERVERTOKEN'
DEFAULT_SYNCPERIODMINUTES    = 1
DEFAULT_BASESTATIONTOKEN     = 'DEFAULT_BASESTATIONTOKEN'

#============================ helpers =========================================

def printCrash(threadName):
    import traceback
    output  = []
    output += ["CRASH in Thread {0}!".format(threadName)]
    output += [traceback.format_exc()]
    output  = '\n'.join(output)
    print output

#============================ classes =========================================

class Stats(object):
    _instance = None
    _init     = False
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(Stats,cls).__new__(cls, *args, **kwargs)
        return cls._instance
    def __init__(self):
        if self._init:
            return
        self._init    = True
        self.dataLock = threading.RLock()
        self.data     = {}
    def incr(self,statName):
        with self.dataLock:
{'fraction_non_alphanumeric': 0.21380753138075315, 'fraction_numerical': 0.0100418410041841, 'mean_word_length': 2.565249813571961, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '601039', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1249, 'n_words': 267}