def METHOD_NAME(cls, hook, before):
    # Returns a decorator that will wrap the existing implementation if it exists,
    # otherwise returns a decorator that will simply add the decorated function to the
    # class.
    if overrides(cls, hook):
        return _make_wrapper(cls, hook, before)
    else:
        return _make_injector(cls, hook)