<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():
 """CERN logout view."""

    logout_url = REMOTE_APP['logout_url']

    apps = current_app.config.get('OAUTHCLIENT_REMOTE_APPS')
    if apps:
        cern_app = apps.get('cern', REMOTE_APP)
        logout_url = cern_app['logout_url']

    return redirect(logout_url, code=302)