<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
	:author: <NAME> | http://muneebali.com
	:license: MIT, see LICENSE for more details.
"""

from flask import Flask, make_response, render_template, jsonify, request

import serial, socket, port_listener, Queue, threading

app = Flask(__name__)

# import the database and the tables from the database
from db import db
from db import Device, Edge

nodes = Device.query.filter_by(d_type='Node').order_by(Device.label).all()
sensors = Device.query.filter_by(d_type='Sensor').order_by(Device.label).all()

from commontools import log
import serial, time, port_listener

#Commands from external sensors and nodes
inCommands = Queue.Queue()

#Setup sockets
HOST = ''                 # Symbolic name meaning all available interfaces
SEND_PORT = 8082              # Arbitrary non-privileged 
RECV_PORT = 8083
conn = None
adr = None

port_handler = port_listener.PortHandler(HOST, SEND_PORT, RECV_PORT)
port_handler.startListener()

def sendMsg(msg):<commit_msg>Commented out the port_listener startup in apache-flask.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
	:author: <NAME> | http://muneebali.com
	:license: MIT, see LICENSE for more details.
"""

from flask import Flask, make_response, render_template, jsonify, request

import serial, socket, port_listener, Queue, threading

app = Flask(__name__)

# import the database and the tables from the database
from db import db
from db import Device, Edge

nodes = Device.query.filter_by(d_type='Node').order_by(Device.label).all()
sensors = Device.query.filter_by(d_type='Sensor').order_by(Device.label).all()

from commontools import log
import serial, time, port_listener

#Commands from external sensors and nodes
inCommands = Queue.Queue()

#Setup sockets
HOST = ''                 # Symbolic name meaning all available interfaces
SEND_PORT = 8082              # Arbitrary non-privileged 
RECV_PORT = 8083
conn = None
adr = None

#port_handler = port_listener.PortHandler(HOST, SEND_PORT, RECV_PORT)
#port_handler.startListener()

def sendMsg(msg):
{'fraction_non_alphanumeric': 0.10657705232837254, 'fraction_numerical': 0.008641382621219395, 'mean_word_length': 4.617250673854447, 'pattern_counts': {'":': 0, '<': 5, '<?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': '754705', 'n_tokens_mistral': 662, 'n_tokens_neox': 646, 'n_words': 193}