def METHOD_NAME(response_format):
    def setup_app(app):
        class RedirectButton(Button):
            def handle_input_event(self, input_event):
                if response_format == 'response-dict':
                    return {
                        'redirect': '/',
                    }
                elif response_format == 'response-class':
                    return RedirectResponse('/')
        @app.route('/')
        class Index(View):
            def handle_request(self, request):
                return 'SUCCESS'
        @app.route('/redirect-from-handle-input-event-root/')
        class RedirectFromHandleInputEventRootView(View):
            def handle_request(self, request):
                return RedirectButton()
            def handle_input_event_root(self, input_event):
                if response_format == 'response-dict':
                    return {
                        'redirect': '/',
                    }
                elif response_format == 'response-class':
                    return RedirectResponse('/')
        @app.route('/redirect-from-handle-input-event/')
        class RedirectFromHandleInputEventView(View):
            def handle_request(self, request):
                return Button()
            def handle_input_event(self, input_event):
                if response_format == 'response-dict':
                    return {
                        'redirect': '/',
                    }
                elif response_format == 'response-class':
                    return RedirectResponse('/')
        @app.route('/redirect-from-button/')
        class RedirectFromButtonView(View):
            def handle_request(self, request):
                return RedirectButton()
        @app.route('/redirect-from-on-view-event/')
        class RedirectFromOnViewEvent(View):
            def handle_request(self, request):
                return 'REDIRECT FROM ON VIEW EVENT'
            def on_view_event(self, view_event):
                if response_format == 'response-dict':
                    return {
                        'redirect': '/',
                    }
                elif response_format == 'response-class':
                    return RedirectResponse('/')
    return setup_app