def redirect(url, code=None):
if not code:<EOL><INDENT>code = <NUM_LIT> if request.get('<STR_LIT>') == "<STR_LIT>" else <NUM_LIT><EOL><DEDENT>res = response.copy(cls=HTTPResponse)<EOL>res.status = code<EOL>res.body = "<STR_LIT>"<EOL>res.set_header('<STR_LIT>', urljoin(request.url, url))<EOL>raise res<EOL>
Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version.