<commit_before>from lablog.interfaces import Interface
import humongolus.field as field
from lablog.util import aes
from lablog import config
from lablog import messages
from datetime import datetime
import json
import logging

k = list(config.SKEY)
k.append(0x00)
SKEY = bytearray(k)
KEY = buffer(SKEY)

class Node(Interface):
    measurement_key = "node"
    exchange = messages.Exchanges.node

    id = field.Char()

    def data(self, data=None):
        j = aes.decrypt(data, KEY)
        j = json.loads(j)
        logging.info(j)
        return j

    def parse_data(self, data):
        v_map = {'t':'temperature','h':'humidity','l':'light','c':'co2','v':'voc','d':'dust','f':'fuel'}
        points = []
        for k,v in data.iteritems():
            k = v_map.get(k, k)<commit_msg>adds decibel support for node<commit_after>from lablog.interfaces import Interface
import humongolus.field as field
from lablog.util import aes
from lablog import config
from lablog import messages
from datetime import datetime
import json
import logging

k = list(config.SKEY)
k.append(0x00)
SKEY = bytearray(k)
KEY = buffer(SKEY)

class Node(Interface):
    measurement_key = "node"
    exchange = messages.Exchanges.node

    id = field.Char()

    def data(self, data=None):
        j = aes.decrypt(data, KEY)
        j = json.loads(j)
        logging.info(j)
        return j

    def parse_data(self, data):
        v_map = {'t':'temperature','h':'humidity','l':'light','c':'co2','v':'voc','d':'dust','f':'fuel', 'n':'decibel'}
        points = []
        for k,v in data.iteritems():
            k = v_map.get(k, k)
{'fraction_non_alphanumeric': 0.14011159330440173, 'fraction_numerical': 0.0049597024178549285, 'mean_word_length': 3.3155080213903743, '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': '1532497', 'n_tokens_mistral': 558, 'n_tokens_neox': 535, 'n_words': 138}