human
I wrote the below code

    def inner(f):
        def wrapped(self, context, *args, **kw):
            try:
                return f(self, context, *args, **kw)
            except Exception as e:
                with excutils.save_and_reraise_exception():
                    if notifier:
                        payload = dict(exception=e)
                        call_dict = safe_utils.getcallargs(f, *args, **kw)
                        cleansed = _cleanse_dict(call_dict)
                        payload.update({'args': cleansed})
                        temp_level = level
                        if (not temp_level):
                            temp_level = notifier.ERROR
                        temp_type = event_type
                        if (not temp_type):
                            temp_type = f.__name__
                        notifier.notify(context, publisher_id, temp_type, temp_level, payload)
        return functools.wraps(f)(wrapped)
    return inner

What's a good function header?
assistant
#Here's a good function header.

def wrap_exception(notifier=None, publisher_id=None, event_type=None, level=None):