human
Complete this python program:
def create_revision(manage_manually=False, using=None, atomic=True):
assistant
#Here is the Python code you requested.

    """View decorator that wraps the request in a revision.
    The revision will have it\s user set from the request automatically.
    """
    def decorator(func):
        @wraps(func)
        def do_revision_view(request, *args, **kwargs):
            if _request_creates_revision(request):
                try:
                    with create_revision_base(manage_manually=manage_manually, using=using, atomic=atomic):
                        response = func(request, *args, **kwargs)
                        if (response.status_code >= 400):
                            raise _RollBackRevisionView(response)
                        _set_user_from_request(request)
                        return response
                except _RollBackRevisionView as ex:
                    return ex.response
            return func(request, *args, **kwargs)
        return do_revision_view
    return decorator