<commit_before># -*- coding: utf-8 -*-
"""
General utilities and exceptions.
"""
from __future__ import (absolute_import, division, print_function)

from collections import defaultdict, namedtuple, Mapping
from functools import wraps
import os
import warnings

from .. import __url__
from .deprecation import Deprecation


def memoize(nargs=0):
    def decorator(func):
        @wraps(func)
        def wrapper(*args):
            if nargs is not None and len(args) > nargs:
                raise ValueError("memoization error")
            if args not in wrapper.results:
                wrapper.results[args] = func(*args)
            return wrapper.results[args]
        wrapper.results = {}
        return wrapper
    return decorator


class defaultkeydict(defaultdict):<commit_msg>Better argument name in decorator<commit_after># -*- coding: utf-8 -*-
"""
General utilities and exceptions.
"""
from __future__ import (absolute_import, division, print_function)

from collections import defaultdict, namedtuple, Mapping
from functools import wraps
import os
import warnings

from .. import __url__
from .deprecation import Deprecation


def memoize(max_nargs=0):
    def decorator(func):
        @wraps(func)
        def wrapper(*args):
            if max_nargs is not None and len(args) > max_nargs:
                raise ValueError("memoization error")
            if args not in wrapper.results:
                wrapper.results[args] = func(*args)
            return wrapper.results[args]
        wrapper.results = {}
        return wrapper
    return decorator


class defaultkeydict(defaultdict):
{'fraction_non_alphanumeric': 0.0859277708592777, 'fraction_numerical': 0.0024906600249066002, 'mean_word_length': 2.9099756690997567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2809457', 'n_tokens_mistral': 437, 'n_tokens_neox': 427, 'n_words': 139}