<commit_before>#!/usr/bin/env python

from time import sleep
from daemonize import Daemonize
import schedule

from lib.configloader.configloader import ConfigLoader
import lib.log.log
import lib.upstream
import lib.sysinfo

_config = ConfigLoader("config")
log = lib.log.log.Log(_config)
logger = log.getLogger()
pid = _config.getPidFile()


def sendSystemNotify():
    logger.debug("Job is working")
    sys = lib.sysinfo.get_notify_system()
    sys = lib.apt.addUpdates(sys)
    logger.debug("Sending to server (notify " + lib.sysinfo.get_hostname() + ")...")
    response = lib.upstream.pushSystemNotify(_config, lib.sysinfo.get_urn(), sys)
    logger.debug("Response:\n" + response)


def main():
    schedule.every(5).minutes.do(sendSystemNotify)

    while True:
        schedule.run_pending()
        sleep(5)


daemon = Daemonize(app="test_app", pid=pid, action=main, keep_fds=log.getKeepfds())
daemon.start()
<commit_msg>added import for lib.apt<commit_after>#!/usr/bin/env python

from time import sleep
from daemonize import Daemonize
import schedule

from lib.configloader.configloader import ConfigLoader
import lib.log.log
import lib.upstream
import lib.sysinfo
import lib.apt

_config = ConfigLoader("config")
log = lib.log.log.Log(_config)
logger = log.getLogger()
pid = _config.getPidFile()


def sendSystemNotify():
    logger.debug("Job is working")
    sys = lib.sysinfo.get_notify_system()
    sys = lib.apt.addUpdates(sys)
    logger.debug("Sending to server (notify " + lib.sysinfo.get_hostname() + ")...")
    response = lib.upstream.pushSystemNotify(_config, lib.sysinfo.get_urn(), sys)
    logger.debug("Response:\n" + response)


def main():
    schedule.every(5).minutes.do(sendSystemNotify)

    while True:
        schedule.run_pending()
        sleep(5)


daemon = Daemonize(app="test_app", pid=pid, action=main, keep_fds=log.getKeepfds())
daemon.start()

{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.0021208907741251328, 'mean_word_length': 4.3914285714285715, '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': '7271578', 'n_tokens_mistral': 627, 'n_tokens_neox': 618, 'n_words': 131}