human
I wrote the below code

    def decorator(f):
        def new_func(*args, **kwargs):
            ctx = get_current_context()
            if ensure:
                obj = ctx.ensure_object(object_type)
            else:
                obj = ctx.find_object(object_type)
            if (obj is None):
                raise RuntimeError(('Managed    to    invoke    callback    without    a    context    object    of    type    %r    existing' % object_type.__name__))
            return ctx.invoke(f, obj, *args[1:], **kwargs)
        return update_wrapper(new_func, f)
    return decorator

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

def make_pass_decorator(object_type, ensure=False):