<commit_before>"""
Created on 15 Mar 2017

@author: <NAME> (<EMAIL>)

A stub class for an NDIRConf that may be implemented elsewhere
"""

from abc import ABC, abstractmethod
from collections import OrderedDict

from scs_core.data.json import PersistentJSONable


# --------------------------------------------------------------------------------------------------------------------

class NDIRConf(PersistentJSONable, ABC):
    """
    classdocs
    """

    _FILENAME = "ndir_conf.json"

    @classmethod
    def persistence_location(cls, host):
        raise NotImplementedError()


    # ----------------------------------------------------------------------------------------------------------------

    def __init__(self, model, tally):
        """
        Constructor
        """
        PersistentJSONable.__init__(self)

        self.__model = model
        self.__tally = tally


    # ----------------------------------------------------------------------------------------------------------------
    # abstract NDIRConf...

    @abstractmethod
    def ndir(self, host):
        pass


    @abstractmethod
    def ndir_monitor(self, host):
        pass


    # ----------------------------------------------------------------------------------------------------------------

    def as_json(self):
        jdict = OrderedDict()

        jdict['model'] = self.model
        jdict['tally'] = self.tally

        return jdict


    # ----------------------------------------------------------------------------------------------------------------
<commit_msg>Added Support for DFE load switches with alternate polarity.<commit_after>"""
Created on 15 Mar 2017

@author: <NAME> (<EMAIL>)

A stub class for an NDIRConf that may be implemented elsewhere
"""

from abc import ABC, abstractmethod
from collections import OrderedDict

from scs_core.data.json import PersistentJSONable


# --------------------------------------------------------------------------------------------------------------------

class NDIRConf(PersistentJSONable, ABC):
    """
    classdocs
    """

    _FILENAME = "ndir_conf.json"

    @classmethod
    def persistence_location(cls, host):
        raise NotImplementedError()


    # ----------------------------------------------------------------------------------------------------------------

    def __init__(self, model, tally):
        """
        Constructor
        """
        PersistentJSONable.__init__(self)

        self.__model = model
        self.__tally = tally


    # ----------------------------------------------------------------------------------------------------------------
    # abstract NDIRConf...

    @abstractmethod
    def ndir(self, host, load_switch_active_high):
        pass


    @abstractmethod
    def ndir_monitor(self, host, load_switch_active_high):
        pass


    # ----------------------------------------------------------------------------------------------------------------

    def as_json(self):
        jdict = OrderedDict()

        jdict['model'] = self.model
        jdict['tally'] = self.tally

        return jdict


    # ----------------------------------------------------------------------------------------------------------------

{'fraction_non_alphanumeric': 0.40921744509743274, 'fraction_numerical': 0.0037117228580266005, 'mean_word_length': 0.8437856328392246, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '641242', 'n_tokens_mistral': 688, 'n_tokens_neox': 625, 'n_words': 164}