<commit_before>from __future__ import unicode_literals

from django.shortcuts import render_to_response, redirect
from django.views.decorators.csrf import csrf_exempt
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.decorators import login_required

from keen.client import KeenClient
import stripe

from resources.utils import get_resource_stats

def index(request):

    hits = cache.get('keen_hit_count')

    if not hits:
        keen = KeenClient(
            project_id=settings.KEEN_PROJECT_ID,
            write_key=settings.KEEN_WRITE_KEY,
            read_key=settings.KEEN_READ_KEY
        )
        hits = keen.count("detail_hit")
        cache.set('keen_hit_count', hits, 60)

    stripe_key = settings.STRIPE_KEYS['publishable']
    return render_to_response('index.html',
        {
            "hits": hits,
            "stripe_key": stripe_key<commit_msg>increase cache to 15 minutes<commit_after>from __future__ import unicode_literals

from django.shortcuts import render_to_response, redirect
from django.views.decorators.csrf import csrf_exempt
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.decorators import login_required

from keen.client import KeenClient
import stripe

from resources.utils import get_resource_stats

def index(request):

    hits = cache.get('keen_hit_count')

    if not hits:
        keen = KeenClient(
            project_id=settings.KEEN_PROJECT_ID,
            write_key=settings.KEEN_WRITE_KEY,
            read_key=settings.KEEN_READ_KEY
        )
        hits = keen.count("detail_hit")
        cache.set('keen_hit_count', hits, 300)

    stripe_key = settings.STRIPE_KEYS['publishable']
    return render_to_response('index.html',
        {
            "hits": hits,
            "stripe_key": stripe_key
{'fraction_non_alphanumeric': 0.07467532467532467, 'fraction_numerical': 0.003787878787878788, 'mean_word_length': 3.3919239904988125, 'pattern_counts': {'":': 4, '<': 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': '2704586', 'n_tokens_mistral': 570, 'n_tokens_neox': 553, 'n_words': 123}