<commit_before>import warnings
from functools import wraps


def deprecated(use_instead=None):
    """This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emitted
    when the function is used."""

    def wrapped(func):
        @wraps(func)
        def new_func(*args, **kwargs):
            message = "Call to deprecated function %s." % func.__name__
            if use_instead:
                message += " Use %s instead." % use_instead

            warnings.warn_explicit(message,
                category=DeprecationWarning,
                filename=func.func_code.co_filename,
                lineno=func.func_code.co_firstlineno + 1,
                registry=func.func_globals.setdefault('__warningregistry__', \
                                                      {}),
                module_globals=func.func_globals)
            return func(*args, **kwargs)
        return new_func
    return wrapped<commit_msg>report caller's file:lineno of deprecated function instead of file:lineno of deprecated function<commit_after>import sys
import warnings
from functools import wraps


def deprecated(use_instead=None):
    """This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emitted
    when the function is used."""

    def wrapped(func):
        @wraps(func)
        def new_func(*args, **kwargs):
            message = "Call to deprecated function %s." % func.__name__
            if use_instead:
                message += " Use %s instead." % use_instead
            warnings.warn(message, category=DeprecationWarning, stacklevel=2)
            return func(*args, **kwargs)
        return new_func
    return wrapped
{'fraction_non_alphanumeric': 0.07851002865329514, 'fraction_numerical': 0.001146131805157593, 'mean_word_length': 2.269662921348315, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2328279', 'n_tokens_mistral': 463, 'n_tokens_neox': 433, 'n_words': 144}