def redirect(url, code=None):
if code is None:<EOL><INDENT>code = <NUM_LIT> if request.get('<STR_LIT>') == "<STR_LIT>" else <NUM_LIT><EOL><DEDENT>location = urljoin(request.url, url)<EOL>raise HTTPResponse("<STR_LIT>", status=code, header=dict(Location=location))<EOL>
Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version.