def METHOD_NAME(*args, **kwargs):
    if bsb.options.profiling:
        session = get_active_session()
        if name_f:
            name = name_f(f, args, kwargs)
        else:
            name = f.__name__
        with session.meter(name, args=str(args), kwargs=str(kwargs)):
            r = f(*args, **kwargs)
        session.flush(stats=False)
        return r
    else:
        return f(*args, **kwargs)