<commit_before>import logging
from uuid import uuid4

from django import http
from django.core.cache import cache

import tweepy


log = logging.getLogger('k')

PREFIX = 'custcare_'
ACCESS_NAME = PREFIX + 'access'
REDIRECT_NAME = PREFIX + 'redirect'
REQUEST_KEY_NAME = PREFIX + 'request_key'
REQUEST_SECRET_NAME = PREFIX + 'request_secret'

MAX_AGE = 3600


def url(request, override=None):
    d = {
        'scheme': 'https' if request.is_secure() else 'http',
        'host': request.get_host(),
        'path': request.get_full_path(),
    }
    if override:
        d.update(override)
    
    return '{0}://{1}{2}'.format(d['scheme'], d['host'], d['path'])

# Twitter sessions are SSL only, so redirect to SSL if needed<commit_msg>Allow unicode through the twitter middleware. [bug 602399]<commit_after>import logging
from uuid import uuid4

from django import http
from django.core.cache import cache

import tweepy


log = logging.getLogger('k')

PREFIX = 'custcare_'
ACCESS_NAME = PREFIX + 'access'
REDIRECT_NAME = PREFIX + 'redirect'
REQUEST_KEY_NAME = PREFIX + 'request_key'
REQUEST_SECRET_NAME = PREFIX + 'request_secret'

MAX_AGE = 3600


def url(request, override=None):
    d = {
        'scheme': 'https' if request.is_secure() else 'http',
        'host': request.get_host(),
        'path': request.get_full_path(),
    }
    if override:
        d.update(override)
    
    return u'%s://%s%s' % (d['scheme'], d['host'], d['path'])

# Twitter sessions are SSL only, so redirect to SSL if needed
{'fraction_non_alphanumeric': 0.12954395241242564, 'fraction_numerical': 0.01255783212161269, 'mean_word_length': 3.821656050955414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5968312', 'n_tokens_mistral': 517, 'n_tokens_neox': 500, 'n_words': 139}