<commit_before>from lib import contract, base

from . import file_loader


class Armor(base.BaseDictionary):
    pass


@contract.accepts(dict)
def load_armors(attack_types):
    args = {}
    names = []
    for armor_ in file_loader.read_and_parse_json('armors'):
        name = str(armor_['name'])
        resists = {}
        for attack_type, multiplier in armor_['resists'].items():
            resists[attack_types[str(attack_type)]] = multiplier
        names.append(name)
        args[name] = resists

    @contract.accepts(str)
    def armor_getter(name):
        return Armor(dict(args[name]))
    return armor_getter, names<commit_msg>Simply return of armor names<commit_after>from lib import contract, base

from . import file_loader


class Armor(base.BaseDictionary):
    pass


@contract.accepts(dict)
def load_armors(attack_types):
    args = {}
    for armor_ in file_loader.read_and_parse_json('armors'):
        name = str(armor_['name'])
        resists = {}
        for attack_type, multiplier in armor_['resists'].items():
            resists[attack_types[str(attack_type)]] = multiplier
        args[name] = resists

    @contract.accepts(str)
    def armor_getter(name):
        return Armor(dict(args[name]))
    return armor_getter, args.keys()
{'fraction_non_alphanumeric': 0.11426319936958235, 'fraction_numerical': 0.0, 'mean_word_length': 3.3642611683848798, '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': '6395474', 'n_tokens_mistral': 410, 'n_tokens_neox': 393, 'n_words': 83}