<commit_before>from six import string_types

from ..types import (
    DotDict,
    LooselyTypedDotDict,
    ListOf,
)

class ActionInternalConfig(DotDict):
    pass

class ActionConfig(LooselyTypedDotDict):
    _allowed_keys = set([
        "module_name",
        "class_name",
        "kwargs"
    ])
    _key_types = {
        "module_name" : str, #This should be string_types. Need to merge in fixes to LooselyTypedDataDcit before that will work, though...
        "class_name" : str, #This should be string_types. Need to merge in fixes to LooselyTypedDataDcit before that will work, though...
        "kwargs" : ActionInternalConfig,
    }

class ActionSetConfig(LooselyTypedDotDict):
    _allowed_keys = set([
        "module_name",
        "class_name",
        "action_list",
    ])

    _key_types = {
        "module_name" : string_types,
        "class_name" : string_types,
        #TODO: This should be a DictOf, not a ListOf.
        "action_list" : ListOf(ActionConfig),
    }<commit_msg>Use new bse types to improve typing<commit_after>from six import string_types

from ..types import (
    DotDict,
    RequiredKeysDotDict,
    AllowedKeysDotDict,
    ListOf,
)

# NOTE : Some day it might make sense to implement 
class ActionInternalConfig(RequiredKeysDotDict):
    """A typed object containing the kwargs for a specific subclass of ValidationAction.
    """
    pass

class ActionConfig(AllowedKeysDotDict):
    _allowed_keys = set([
        "module_name",
        "class_name",
        "kwargs"
    ])
    _key_types = {
        "module_name" : str, #TODO: This should be string_types. Need to merge in fixes to LooselyTypedDataDcit before that will work, though...
        "class_name" : str, #TODO: This should be string_types. Need to merge in fixes to LooselyTypedDataDcit before that will work, though...
        #TODO: Add this back in.
        # "kwargs" : ActionInternalConfig,
    }

class ActionSetConfig(AllowedKeysDotDict):
    _allowed_keys = set([
        "module_name",
        "class_name",
        "action_list",
    ])

    _key_types = {
        "module_name" : string_types,
        "class_name" : string_types,
        #TODO: This should be a DictOf, not a ListOf.
        "action_list" : ListOf(ActionConfig),
    }
{'fraction_non_alphanumeric': 0.09026548672566372, 'fraction_numerical': 0.0, 'mean_word_length': 2.7872696817420435, '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': '5983213', 'n_tokens_mistral': 695, 'n_tokens_neox': 693, 'n_words': 199}