<commit_before>"""
This file loads and maintains the configuration of the application
"""


class Configuration:
    def __init__(self, marker, begin, end=None):
        self.marker = marker
        self.begin = begin
        self.end = end

    def __str__(self):
        return self.marker + " --> " + self.begin + " " +  self.end

sourcecode_added = False
configuration = []


def load_configuration(config_file="mdxml.conf"):
    config = open(config_file)
    config_lines = config.readlines()
    for line in config_lines:
        if len(line.strip()) == 0:
            continue
        params = line.split()
        marker = params[0]
        begin = params[1]
        if len(params) >= 3:
            end =params[2]
        else:
            end =None
        configuration.append(Configuration(marker, begin, end))

def print_configuration():
    for configuration_element in configuration:
        print configuration_element<commit_msg>change config to map to do not depend on the order in the config file<commit_after>"""
This file loads and maintains the configuration of the application
"""


class Configuration:
    def __init__(self, marker, begin, end=None):
        self.marker = marker
        self.begin = begin
        self.end = end

    def __str__(self):
        return self.marker + " --> " + self.begin + " " +  self.end

sourcecode_added = False
configuration = {}


def load_configuration(config_file="mdxml.conf"):
    config = open(config_file)
    config_lines = config.readlines()
    for line in config_lines:
        if len(line.strip()) == 0:
            continue
        params = line.split()
        marker = params[0]
        begin = params[1]
        if len(params) >= 3:
            end =params[2]
        else:
            end =None
        configuration[marker] = (Configuration(marker, begin, end))

def print_configuration():
    for key in configuration:
        print configuration[key]
{'fraction_non_alphanumeric': 0.10346611484738748, 'fraction_numerical': 0.005173305742369374, 'mean_word_length': 2.4659498207885306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4285494', 'n_tokens_mistral': 536, 'n_tokens_neox': 525, 'n_words': 158}