<commit_before>from django.template import RequestContext
from django.template.defaultfilters import escape
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.http import HttpResponse, Http404, HttpResponseRedirect, QueryDict
from django.core.urlresolvers import reverse
#from django.views.decorators.gzip import gzip_page
from server.models import RenderResult
import os
import glob
import datetime

try:
  from server.handlers import redict, redict_meta, redict_auth, handle
except Exception as errorresult:
  print ('Unable to import file handlers from waveserv.server.handlers!\n%s'%errorresult)
  raise

from server.models import Project
project = Project.objects.all()[0]
print project

page_titles = {	'index':	'Index',
		'show':		'Figure: %s',
}

defSortKey = 'filename'
freshthresh = 0.1

DEBUG = project.debug
VERBOSE = project.verbose
DIBUPATH = project.dibupath
try:
  os.mkdir(DIBUPATH)
except OSError as (errno, strerror):
  if (errno != 17): # Exists
    raise

# ------------------------------------------------------------------------
# Helper functions

def clean_input (filename):
  result = os.path.basename(filename)
  return result

# ========================================================================
# View Handlers
#
# NB: The following are handled by Django in urls.py
# /download/*
# /media/*

# ------------------------------------------------------------------------
# Main site index

def view_index (request):
  s = request.session<commit_msg>Added gzip compression on index page; major (perhaps 10x) speed increase.<commit_after>from django.template import RequestContext
from django.template.defaultfilters import escape
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.http import HttpResponse, Http404, HttpResponseRedirect, QueryDict
from django.core.urlresolvers import reverse
from django.views.decorators.gzip import gzip_page
from server.models import RenderResult
import os
import glob
import datetime

try:
  from server.handlers import redict, redict_meta, redict_auth, handle
except Exception as errorresult:
  print ('Unable to import file handlers from waveserv.server.handlers!\n%s'%errorresult)
  raise

from server.models import Project
project = Project.objects.all()[0]
print project

page_titles = {	'index':	'Index',
		'show':		'Figure: %s',
}

defSortKey = 'filename'
freshthresh = 0.1

DEBUG = project.debug
VERBOSE = project.verbose
DIBUPATH = project.dibupath
try:
  os.mkdir(DIBUPATH)
except OSError as (errno, strerror):
  if (errno != 17): # Exists
    raise

# ------------------------------------------------------------------------
# Helper functions

def clean_input (filename):
  result = os.path.basename(filename)
  return result

# ========================================================================
# View Handlers
#
# NB: The following are handled by Django in urls.py
# /download/*
# /media/*

# ------------------------------------------------------------------------
# Main site index

@gzip_page
def view_index (request):
  s = request.session
{'fraction_non_alphanumeric': 0.21571152607855762, 'fraction_numerical': 0.0077269800386349004, 'mean_word_length': 3.2503419972640217, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7081242', 'n_tokens_mistral': 874, 'n_tokens_neox': 838, 'n_words': 262}