def METHOD_NAME(fn):
    """Filter out Keras-internal stack trace frames in exceptions raised by
    fn."""
    if sys.version_info.major != 3 or sys.version_info.minor < 7:
        return fn
    def error_handler(*args, **kwargs):
        if not tf.debugging.is_traceback_filtering_enabled():
            return fn(*args, **kwargs)
        filtered_tb = None
        try:
            return fn(*args, **kwargs)
        except Exception as e:
            filtered_tb = _process_traceback_frames(e.__traceback__)
            # To get the full stack trace, call:
            # `tf.debugging.disable_traceback_filtering()`
            raise e.with_traceback(filtered_tb) from None
        finally:
            del filtered_tb
    return tf.__internal__.decorator.make_decorator(fn, error_handler)