<commit_before>from malcolm.core.attributemeta import AttributeMeta


class StringMeta(AttributeMeta):
    """Meta object containing information for a string"""

    def __init__(self, name, value):
        super(StringMeta, self).__init__(name=name)

        self.value = self.validate(value)

    def validate(self, value):
        """
        Check if the value is None and returns None, else casts value to a
        string and returns it

        Args:
            value(): Value to validate

        Returns:
            str: Value as a string [If value is not None]
        """

        if value is None:
            return None
        else:
            return str(value)<commit_msg>Removed value from AttributeMeta<commit_after>from malcolm.core.attributemeta import AttributeMeta


class StringMeta(AttributeMeta):
    """Meta object containing information for a string"""

    def __init__(self, name):
        super(StringMeta, self).__init__(name=name)

    def validate(self, value):
        """
        Check if the value is None and returns None, else casts value to a
        string and returns it

        Args:
            value(): Value to validate

        Returns:
            str: Value as a string [If value is not None]
        """

        if value is None:
            return None
        else:
            return str(value)
{'fraction_non_alphanumeric': 0.07549962990377498, 'fraction_numerical': 0.0, 'mean_word_length': 2.1224018475750577, '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': '6313753', 'n_tokens_mistral': 349, 'n_tokens_neox': 332, 'n_words': 133}