<commit_before>#include "depthai/pipeline/AssetManager.hpp"

#include "spdlog/fmt/fmt.h"
#include "utility/spdlog-fmt.hpp"

// std
#include <fstream>

namespace dai {

std::string Asset::getRelativeUri() {
    return fmt::format("{}:{}", "asset", key);
}

std::shared_ptr<dai::Asset> AssetManager::set(Asset asset) {
    // make sure that key doesn't exist already
    if(assetMap.count(asset.key) > 0) throw std::logic_error("An Asset with the key: " + asset.key + " already exists.");
    std::string key = asset.key;
    assetMap[key] = std::make_shared<Asset>(std::move(asset));
    return assetMap[key];
}

std::shared_ptr<dai::Asset> AssetManager::set(const std::string& key, Asset asset) {<commit_msg>Fixed AssetManager 'set' function to allow overwriting an asset<commit_after>#include "depthai/pipeline/AssetManager.hpp"

#include "spdlog/fmt/fmt.h"
#include "utility/spdlog-fmt.hpp"

// std
#include <fstream>

namespace dai {

std::string Asset::getRelativeUri() {
    return fmt::format("{}:{}", "asset", key);
}

std::shared_ptr<dai::Asset> AssetManager::set(Asset asset) {
    std::string key = asset.key;
    assetMap[key] = std::make_shared<Asset>(std::move(asset));
    return assetMap[key];
}

std::shared_ptr<dai::Asset> AssetManager::set(const std::string& key, Asset asset) {
{'fraction_non_alphanumeric': 0.1743827160493827, 'fraction_numerical': 0.0007716049382716049, 'mean_word_length': 5.583756345177665, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '7461293', 'n_tokens_mistral': 454, 'n_tokens_neox': 448, 'n_words': 92}