<commit_before>from asyncio import get_event_loop
from daq.publishers.redis_publisher import RedisPublisher
from daq.rfxcom_emiter_receiver import RfxcomReader
from subscribers.redis_toolbox import create_redis_pool


dev_name = '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1XZI13O-if00-port0'


def calculate_in_minutes(temperature):
    if temperature < 8.0:
        return 0
    return temperature/2 * 60


if __name__ == '__main__':
    try:
        redis_conn = create_redis_pool()
        RfxcomReader(dev_name, RedisPublisher(redis_conn))
        get_event_loop().run_forever()
    finally:
        get_event_loop().close()<commit_msg>[fix] main from filtration_duration was not accurate<commit_after>import asyncio
from daq.publishers.redis_publisher import RedisPublisher
from daq.rfxcom_emiter_receiver import RfxcomReader, RFXCOM_KEY
from subscribers.redis_toolbox import create_redis_pool


dev_name = '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1XZI13O-if00-port0'


def calculate_in_minutes(temperature):
    if temperature < 8.0:
        return 0
    return temperature/2 * 60


@asyncio.coroutine
def create_publisher():
    redis_conn = yield from create_redis_pool()
    return RfxcomReader(dev_name, RedisPublisher(redis_conn, RFXCOM_KEY))


if __name__ == '__main__':
    try:
        publisher = asyncio.async(create_publisher())
        asyncio.get_event_loop().run_forever()
    finally:
        asyncio.get_event_loop().close()
{'fraction_non_alphanumeric': 0.08240997229916898, 'fraction_numerical': 0.02077562326869806, 'mean_word_length': 4.473484848484849, 'pattern_counts': {'":': 0, '<': 5, '<?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': '915372', 'n_tokens_mistral': 534, 'n_tokens_neox': 495, 'n_words': 91}