<commit_before>import errno
import json
import os
import types
import typing as t

from werkzeug.utils import import_string


def _json_loads(raw: t.Union[str, bytes]) -> t.Any:
    try:
        return json.loads(raw)
    except json.JSONDecodeError:
        return raw


class ConfigAttribute:
    """Makes an attribute forward to the config"""

    def __init__(self, name: str, get_converter: t.Optional[t.Callable] = None) -> None:
        self.__name__ = name
        self.get_converter = get_converter

    def __get__(self, obj: t.Any, owner: t.Any = None) -> t.Any:
        if obj is None:
            return self
        rv = obj.config[self.__name__]
        if self.get_converter is not None:
            rv = self.get_converter(rv)<commit_msg>clean up unused function from prefixed_env pr<commit_after>import errno
import json
import os
import types
import typing as t

from werkzeug.utils import import_string


class ConfigAttribute:
    """Makes an attribute forward to the config"""

    def __init__(self, name: str, get_converter: t.Optional[t.Callable] = None) -> None:
        self.__name__ = name
        self.get_converter = get_converter

    def __get__(self, obj: t.Any, owner: t.Any = None) -> t.Any:
        if obj is None:
            return self
        rv = obj.config[self.__name__]
        if self.get_converter is not None:
            rv = self.get_converter(rv)
{'fraction_non_alphanumeric': 0.08954154727793696, 'fraction_numerical': 0.0, 'mean_word_length': 2.7253333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5749823', 'n_tokens_mistral': 436, 'n_tokens_neox': 427, 'n_words': 137}