<commit_before># View for semi-static templatized content. 
#
# List of valid templates is explicitly managed for (short-term)
# security reasons.

from mitxmako.shortcuts import render_to_response, render_to_string
from django.shortcuts import redirect
from django.core.context_processors import csrf
from django.conf import settings

#valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html']
valid_templates=['index.html', 
                 'tos.html', 
                 'privacy.html', 
                 'honor.html', 
                 'copyright.html', 
                 '404.html']

print "!!",settings.__dict__

if settings.STATIC_GRAB: 
    valid_templates = valid_templates+['server-down.html',
                                       'server-error.html'
                                       'server-overloaded.html', 
                                       'mitx_global.html', 
                                       'mitx-overview.html', 
                                       '6002x-faq.html',
                                       '6002x-press-release.html'
                                       ]

def index(request, template): 
    csrf_token = csrf(request)['csrf_token']
    if template in valid_templates:<commit_msg>Removed random debug code<commit_after># View for semi-static templatized content. 
#
# List of valid templates is explicitly managed for (short-term)
# security reasons.

from mitxmako.shortcuts import render_to_response, render_to_string
from django.shortcuts import redirect
from django.core.context_processors import csrf
from django.conf import settings

#valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html']
valid_templates=['index.html', 
                 'tos.html', 
                 'privacy.html', 
                 'honor.html', 
                 'copyright.html', 
                 '404.html']

if settings.STATIC_GRAB: 
    valid_templates = valid_templates+['server-down.html',
                                       'server-error.html'
                                       'server-overloaded.html', 
                                       'mitx_global.html', 
                                       'mitx-overview.html', 
                                       '6002x-faq.html',
                                       '6002x-press-release.html'
                                       ]

def index(request, template): 
    csrf_token = csrf(request)['csrf_token']
    if template in valid_templates:
{'fraction_non_alphanumeric': 0.09470304975922954, 'fraction_numerical': 0.00882825040128411, 'mean_word_length': 1.5386965376782078, '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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5299117', 'n_tokens_mistral': 677, 'n_tokens_neox': 628, 'n_words': 130}