human
Complete this python program:
def auth_wanted(view_func):
assistant
#Here is the Python code you requested.

    """Twitter sessions are SSL only, so redirect to SSL if needed.
    Don\t redirect if TWITTER_COOKIE_SECURE is False.
    """
    def wrapper(request, *args, **kwargs):
        is_secure = settings.TWITTER_COOKIE_SECURE
        if (request.COOKIES.get(REDIRECT_NAME) and (is_secure and (not request.is_secure()))):
            ssl_url = url(request, {'scheme': ('https' if is_secure else 'http')})
            return http.HttpResponseRedirect(ssl_url)
        return view_func(request, *args, **kwargs)
    return wrapper