def METHOD_NAME(obj):
    """
    Adds a message to be used as a prefix when emitting warnings and errors.
    """
    sourcefile, lineno = _get_source_location(obj)
    GENERATOR_STATS._traces.append((sourcefile, lineno, obj.__name__))
    yield
    GENERATOR_STATS._traces.pop()