<commit_before>from conf import ServiceConfigure
from copy import deepcopy
from utils import merge_dicts


class BlippConfigure(ServiceConfigure):
    def __init__(self, file_loc=None, unis_url=None,
                 service_id=None, node_id=None, service_name=None):
        if service_name==None:
            service_name="blipp"
        super(BlippConfigure, self).__init__(file_loc, unis_url, service_id, node_id, service_name)

    def expand_probe_config(self):
        '''Configuration for probes has 3 levels, there are the
           service level probe_defaults, the defaults for each probe
           under "probes", and then specific config under "targets"
           for each actual instance of that particular
           probe. "targets" may not exist in which case there is one
           instance of that probe type. Each probe instance's actual
           config is the top level default, overidden by anything in
           probe_defaults, which in turn is overridden by anything in
           "targets".  This method returns a list of the final probe
           instances and their configurations
        '''
        probes = self.config["properties"]["configurations"]["probes"]
        probe_defaults = self.config["properties"]["configurations"]["probe_defaults"]
        configurations = deepcopy(self.config["properties"]["configurations"])
        del configurations["probe_defaults"]
        del configurations["probes"]
        probelist = []
        for name,probe in probes.iteritems():
            if "targets" in probe:
                targets = probe["targets"]
                for target in targets:
                    pconf = deepcopy(configurations)<commit_msg>blipp_conf needs query_service arg as well<commit_after>from conf import ServiceConfigure
from copy import deepcopy
from utils import merge_dicts


class BlippConfigure(ServiceConfigure):
    def __init__(self, file_loc=None, unis_url=None, service_id=None,
                 node_id=None, service_name=None, query_service=True):
        if service_name==None:
            service_name="blipp"
        super(BlippConfigure, self).__init__(file_loc, unis_url, service_id,
                                             node_id, service_name, query_service)

    def expand_probe_config(self):
        '''Configuration for probes has 3 levels, there are the
           service level probe_defaults, the defaults for each probe
           under "probes", and then specific config under "targets"
           for each actual instance of that particular
           probe. "targets" may not exist in which case there is one
           instance of that probe type. Each probe instance's actual
           config is the top level default, overidden by anything in
           probe_defaults, which in turn is overridden by anything in
           "targets".  This method returns a list of the final probe
           instances and their configurations
        '''
        probes = self.config["properties"]["configurations"]["probes"]
        probe_defaults = self.config["properties"]["configurations"]["probe_defaults"]
        configurations = deepcopy(self.config["properties"]["configurations"])
        del configurations["probe_defaults"]
        del configurations["probes"]
        probelist = []
        for name,probe in probes.iteritems():
            if "targets" in probe:
                targets = probe["targets"]
                for target in targets:
                    pconf = deepcopy(configurations)
{'fraction_non_alphanumeric': 0.07450756494433343, 'fraction_numerical': 0.0005709391949757351, 'mean_word_length': 2.669109947643979, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '765169', 'n_tokens_mistral': 852, 'n_tokens_neox': 853, 'n_words': 294}