<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

import requests
import os
import sys
import json
import time
import importlib
import random
import threading
import argparse
import flask

def load_class_from_module(importstring):
    module_name, class_name = importstring.rsplit('.', 1)
    module = importlib.import_module(module_name)
    klass = getattr(module, class_name)
    return klass


class Client(object):

    def __init__(self, master, config_file):
        # Read from config.ini / pub- and priv-key files etc ??
        self.id = None
        self.terminate = False
        self.app = flask.Flask(__name__)
        self.unit_type = None
        self.checkin_frequency = None
        self.priv_key = ".ssh/id_rsa"
        self.certificate = None

        # setup url handlers
        self.configure_url_routes()

        # Replace with NFC discovery ??
        self.register_url = "http://%s/register-unit" % master
        self.checkin_url = None
        self.registry_url = None

        # Read config.ini
        with open(config_file) as config_fh:
            props = json.load(config_fh)

        self.subscribe_to = propps.get('subscribe_to', [])

        self.unit_type = props['unit_type']
        self.checkin_frequency = props['checkin_frequency']

        self.actuators = {}
        for interface, actuator_class in props.get("actuators", {}).items():
            klass = load_class_from_module(actuator_class)
            self.actuators[interface] = klass(interface)

        self.sensors = {}<commit_msg>Fix typo<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

import requests
import os
import sys
import json
import time
import importlib
import random
import threading
import argparse
import flask

def load_class_from_module(importstring):
    module_name, class_name = importstring.rsplit('.', 1)
    module = importlib.import_module(module_name)
    klass = getattr(module, class_name)
    return klass


class Client(object):

    def __init__(self, master, config_file):
        # Read from config.ini / pub- and priv-key files etc ??
        self.id = None
        self.terminate = False
        self.app = flask.Flask(__name__)
        self.unit_type = None
        self.checkin_frequency = None
        self.priv_key = ".ssh/id_rsa"
        self.certificate = None

        # setup url handlers
        self.configure_url_routes()

        # Replace with NFC discovery ??
        self.register_url = "http://%s/register-unit" % master
        self.checkin_url = None
        self.registry_url = None

        # Read config.ini
        with open(config_file) as config_fh:
            props = json.load(config_fh)

        self.subscribe_to = props.get('subscribe_to', [])

        self.unit_type = props['unit_type']
        self.checkin_frequency = props['checkin_frequency']

        self.actuators = {}
        for interface, actuator_class in props.get("actuators", {}).items():
            klass = load_class_from_module(actuator_class)
            self.actuators[interface] = klass(interface)

        self.sensors = {}
{'fraction_non_alphanumeric': 0.10123296560674887, 'fraction_numerical': 0.0012978585334198572, 'mean_word_length': 2.6016355140186915, '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': '303590', 'n_tokens_mistral': 943, 'n_tokens_neox': 907, 'n_words': 211}