<commit_before>once_set = set()

def once(key):
    if key in once_set:
        return False
    else:
        once_set.add(key)
        return True

already_complained = set()


def deprecated(replacement=None):
    def outer(func):
        def inner(*args, **kwargs):
            if func not in already_complained:
                if replacement is None:
                    print("\x1b[31;1mDeprecation warning: Don't use %s\x1b[0m" % (func.__name__))
                else:
                    print("\x1b[31;1mDeprecation warning: Use %s instead of %s\x1b[0m" % (replacement, func.__name__))
                already_complained.add(func)
            return func(*args, **kwargs)
        return inner
    return outer<commit_msg>Use python's native warning system for deprecation warnings (#3324)<commit_after>import warnings


once_set = set()

def once(key):
    if key in once_set:
        return False
    else:
        once_set.add(key)
        return True

already_complained = set()


def deprecated(replacement=None):
    def outer(func):
        def inner(*args, **kwargs):
            if func not in already_complained:
                if replacement is None:
                    warnings.warn("Don't use %s" % (func.__name__), DeprecationWarning)
                else:
                    warnings.warn("Use %s instead of %s" % (replacement, func.__name__), DeprecationWarning)
                already_complained.add(func)
            return func(*args, **kwargs)
        return inner
    return outer
{'fraction_non_alphanumeric': 0.0977542932628798, 'fraction_numerical': 0.010568031704095112, 'mean_word_length': 2.11088295687885, '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': '603341', 'n_tokens_mistral': 460, 'n_tokens_neox': 428, 'n_words': 119}