<commit_before>//=======================================================================
// Copyright (c) 2015-2016 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

namespace asgard {

const std::size_t UNIX_PATH_MAX = 108;
const std::size_t buffer_size = 4096;

struct KeyValue {
    std::string key;
    std::string value;
};

inline void load_config(std::vector<KeyValue>& config) {
    std::ifstream file("/etc/asgard/conf");
    std::string str;
    std::size_t i = 0;

    while (std::getline(file, str)) {
        std::istringstream line(str);
        config.push_back(KeyValue());
        if (std::getline(line, config[i].key, '=')) {
            if (std::getline(line, config[i].value)) {
                i++;
            }
        }
    }
}

inline std::string get_string_value(std::vector<KeyValue>& config, const std::string& key) {
    for (std::size_t i = 0; i < config.size(); ++i) {
        if (config[i].key == key) {
            return config[i].value;
        }
    }
    std::cout << "Key not found !" << std::endl;
    return "";
}

inline int get_int_value(std::vector<KeyValue>& config, const std::string& key) {
    for (std::size_t i = 0; i < config.size(); ++i) {
        if (config[i].key == key) {
            return std::stoi(config[i].value);
        }
    }
    std::cout << "Key not found !" << std::endl;
    return -1;
}

} //end of namespace asgard
<commit_msg>Change get_string_value() format<commit_after>//=======================================================================
// Copyright (c) 2015-2016 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

namespace asgard {

const std::size_t UNIX_PATH_MAX = 108;
const std::size_t buffer_size = 4096;

struct KeyValue {
    std::string key;
    std::string value;
};

inline void load_config(std::vector<KeyValue>& config) {
    std::ifstream file("/etc/asgard/conf");
    std::string str;
    std::size_t i = 0;

    while (std::getline(file, str)) {
        std::istringstream line(str);
        config.push_back(KeyValue());
        if (std::getline(line, config[i].key, '=')) {
            if (std::getline(line, config[i].value)) {
                i++;
            }
        }
    }
}

inline const char* get_string_value(std::vector<KeyValue>& config, const std::string& key) {
    for (std::size_t i = 0; i < config.size(); ++i) {
        if (config[i].key == key) {
            return config[i].value.c_str();
        }
    }
    std::cout << "Key not found !" << std::endl;
    return "";
}

inline int get_int_value(std::vector<KeyValue>& config, const std::string& key) {
    for (std::size_t i = 0; i < config.size(); ++i) {
        if (config[i].key == key) {
            return std::stoi(config[i].value);
        }
    }
    std::cout << "Key not found !" << std::endl;
    return -1;
}

} //end of namespace asgard

{'fraction_non_alphanumeric': 0.2458029775102946, 'fraction_numerical': 0.012036743744060817, 'mean_word_length': 2.9924146649810366, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 11, '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': '1846657', 'n_tokens_mistral': 1038, 'n_tokens_neox': 973, 'n_words': 235}