<commit_before>__author__ = '<NAME>'

import system.storage.files as files
from system.storage.config import YamlConfig

from system.storage.exceptions import OtherOwnershipError, \
    UnknownStorageTypeError
from system.singleton import Singleton
from utils.log import getLogger


warning = """
************************************************
*              /!\\ WARNING! /!\\              *
*                                              *
* A plugin has registered itself as an editor. *
* This means that it can edit and read all of  *
* the data files registered by other plugins.  *
*                                              *
* The plugin details are as follows:           *
* Instance: %s                                 *
*                                              *
* If you don't recognise this plugin or don't  *
* know why it would need this kind of access,  *
* then you should stop the bot immediately and *
* do some research!                            *
*                                              *
* This warning can be disabled by setting      *
* `editor_warning` in settings.yml to `off`.   *
************************************************
"""


class StorageManager(object):
    """
    Centralised data and configuration storage and access.
    """

    __metaclass__ = Singleton

    conf_path = ""
    data_path = ""

    config_files = {}
    data_files = {}

    editors = []

    editor_warning = False

    def __init__(self, conf_path="config/", data_path="data/"):
        self.conf_path = conf_path
        self.data_path = data_path

        self.log = getLogger("Storage")

        config = YamlConfig("config/settings.yml")
        self.editor_warning = config.get("editor_warning", self.editor_warning)

    def get_file(self, obj, storage_type, file_format, path, *args, **kwargs):<commit_msg>Make storage manger load main config from the passed-in conf path<commit_after>__author__ = '<NAME>'

import system.storage.files as files
from system.storage.config import YamlConfig

from system.storage.exceptions import OtherOwnershipError, \
    UnknownStorageTypeError
from system.singleton import Singleton
from utils.log import getLogger


warning = """
************************************************
*              /!\\ WARNING! /!\\              *
*                                              *
* A plugin has registered itself as an editor. *
* This means that it can edit and read all of  *
* the data files registered by other plugins.  *
*                                              *
* The plugin details are as follows:           *
* Instance: %s                                 *
*                                              *
* If you don't recognise this plugin or don't  *
* know why it would need this kind of access,  *
* then you should stop the bot immediately and *
* do some research!                            *
*                                              *
* This warning can be disabled by setting      *
* `editor_warning` in settings.yml to `off`.   *
************************************************
"""


class StorageManager(object):
    """
    Centralised data and configuration storage and access.
    """

    __metaclass__ = Singleton

    conf_path = ""
    data_path = ""

    config_files = {}
    data_files = {}

    editors = []

    editor_warning = False

    def __init__(self, conf_path="config/", data_path="data/"):
        self.conf_path = conf_path
        self.data_path = data_path

        self.log = getLogger("Storage")

        config = YamlConfig("%ssettings.yml" % conf_path)
        self.editor_warning = config.get("editor_warning", self.editor_warning)

    def get_file(self, obj, storage_type, file_format, path, *args, **kwargs):
{'fraction_non_alphanumeric': 0.13635153129161118, 'fraction_numerical': 0.0, 'mean_word_length': 1.992828685258964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5254832', 'n_tokens_mistral': 940, 'n_tokens_neox': 905, 'n_words': 288}