<commit_before>from procgame import dmd 
from procgame.dmd.sdl2_displaymanager import sdl2_DisplayManager
import sdl2
"""
"""
import os
import sys
import yaml
import logging
# logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
from procgame.yaml_helper import value_for_key

class DictWithDefault(dict):
    # def set_default_miss_key(self, default_miss_key):
    #     self.miss_key = default_miss_key
    def __init__(self, default_miss_key):
        dict.__init__(self)
        self.miss_key = default_miss_key

    def __missing__(self, key):
        logging.error("***ASSET ERROR: An asset with key '%s' has not been loaded.  Using default '%s' instead" % (key, self.miss_key))
        if(not self.miss_key in self):
            raise KeyError("***ASSET ERROR: An asset with key '%s' has not been loaded.  And default '%s' could not be found to be used instead!" % (key, self.miss_key))
        return self[self.miss_key]

class AssetManager(object):
    """ The AssetManager class reads the asset_list.yaml file, loading from it Animations, Fonts, Lampshows, etc.
         the values data structure is loaded from :file:`./config/asset_list.yaml` when this submodule is loaded;
         if not found there, the asset_loader will try :file:`./asset_list.yaml` before giving up.
    """

    values = None
    game = None

    loaded_map = {}
    animations = DictWithDefault(default_miss_key='missing')
    lengths = DictWithDefault(default_miss_key='missing')
    fonts = DictWithDefault(default_miss_key='default')
    sounds = {}
    fontstyles = {}
    numLoaded = 0
    dmd_path =""
    # screen = None
    # pygF = None
    total = ""
    
    def value_for_key_path(self, keypath, default=None):
        return value_for_key(self.values,keypath, default)
<commit_msg>fixes a bug with `AssetListFiles` in asset_list.yaml (which lets you specify multiple/external asset files)<commit_after>from procgame import dmd 
from procgame.dmd.sdl2_displaymanager import sdl2_DisplayManager
import sdl2
"""
"""
import os
import sys
import yaml
import logging
# logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
from procgame.yaml_helper import value_for_key

class DictWithDefault(dict):
    # def set_default_miss_key(self, default_miss_key):
    #     self.miss_key = default_miss_key
    def __init__(self, default_miss_key):
        dict.__init__(self)
        self.miss_key = default_miss_key

    def __missing__(self, key):
        logging.error("***ASSET ERROR: An asset with key '%s' has not been loaded.  Using default '%s' instead" % (key, self.miss_key))
        if(not self.miss_key in self):
            raise KeyError("***ASSET ERROR: An asset with key '%s' has not been loaded.  And default '%s' could not be found to be used instead!" % (key, self.miss_key))
        return self[self.miss_key]

class AssetManager(object):
    """ The AssetManager class reads the asset_list.yaml file, loading from it Animations, Fonts, Lampshows, etc.
         the values data structure is loaded from :file:`./config/asset_list.yaml` when this submodule is loaded;
         if not found there, the asset_loader will try :file:`./asset_list.yaml` before giving up.
    """

    values = None
    game = None

    loaded_map = {}
    loaded_assets_files = []
    animations = DictWithDefault(default_miss_key='missing')
    lengths = DictWithDefault(default_miss_key='missing')
    fonts = DictWithDefault(default_miss_key='default')
    sounds = {}
    fontstyles = {}
    numLoaded = 0
    dmd_path =""
    # screen = None
    # pygF = None
    total = ""
    
    def value_for_key_path(self, keypath, default=None):
        return value_for_key(self.values,keypath, default)

{'fraction_non_alphanumeric': 0.10488771466314399, 'fraction_numerical': 0.0021136063408190224, 'mean_word_length': 3.6340269277845776, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6505721', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1172, 'n_words': 334}