<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def logout():
    " View function which handles a logout request. "
    users.logout()
    return redirect(request.referrer or url_for(users._login_manager.login_view))