<commit_before>package mealplanner

import (
	"http"
	"fmt"
	"appengine"
	"appengine/user"
	"appengine/datastore"
	"appengine/mail"
	"appengine/memcache"
	"strings"
	"os"
	"io"
	"json"
	"unicode"
	"time"
)

func init() {
	http.HandleFunc("/", errorHandler(indexHandler))
	http.HandleFunc("/dish", cacheHandler(dishHandler))
	http.HandleFunc("/dish/", cacheHandler(dishHandler))
	http.HandleFunc("/users", permHandler(usersHandler))
	http.HandleFunc("/ingredient", cacheHandler(ingredientHandler))
	http.HandleFunc("/ingredient/", cacheHandler(ingredientHandler))
	http.HandleFunc("/menu/", cacheHandler(menuHandler))
	// search uses POST for a read, we don't use permHandler because
	// it would block searches of readonly libraries
	http.HandleFunc("/search", errorHandler(searchHandler))
	http.HandleFunc("/tags", cacheHandler(allTagsHandler))
	http.HandleFunc("/backup", permHandler(backupHandler))
	http.HandleFunc("/restore", permHandler(restoreHandler))
	http.HandleFunc("/share/", errorHandler(shareHandler))
	http.HandleFunc("/shareAccept/", errorHandler(shareAcceptHandler))
	http.HandleFunc("/libraries", errorHandler(librariesHandler))
	http.HandleFunc("/switch/", errorHandler(switchHandler))
	http.HandleFunc("/deletelib", errorHandler(deletelibHandler))
}

type handlerFunc func(c *context)

// errorHandler catches errors and prints an HTTP 500 error 
func errorHandler(handler handlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		defer func() {
			if err, ok := recover().(os.Error); ok {
				w.WriteHeader(http.StatusInternalServerError)
				fmt.Fprintf(w, "%v", err)
			}
		}()
		c := newContext(w, r)
		handler(c)
	}<commit_msg>removing /tags from caching<commit_after>package mealplanner

import (
	"http"
	"fmt"
	"appengine"
	"appengine/user"
	"appengine/datastore"
	"appengine/mail"
	"appengine/memcache"
	"strings"
	"os"
	"io"
	"json"
	"unicode"
	"time"
)

func init() {
	http.HandleFunc("/", errorHandler(indexHandler))
	http.HandleFunc("/dish", cacheHandler(dishHandler))
	http.HandleFunc("/dish/", cacheHandler(dishHandler))
	http.HandleFunc("/users", permHandler(usersHandler))
	http.HandleFunc("/ingredient", cacheHandler(ingredientHandler))
	http.HandleFunc("/ingredient/", cacheHandler(ingredientHandler))
	http.HandleFunc("/menu/", cacheHandler(menuHandler))
	// search uses POST for a read, we don't use permHandler because
	// it would block searches of readonly libraries
	http.HandleFunc("/search", errorHandler(searchHandler))
	http.HandleFunc("/tags", permHandler(allTagsHandler))
	http.HandleFunc("/backup", permHandler(backupHandler))
	http.HandleFunc("/restore", permHandler(restoreHandler))
	http.HandleFunc("/share/", errorHandler(shareHandler))
	http.HandleFunc("/shareAccept/", errorHandler(shareAcceptHandler))
	http.HandleFunc("/libraries", errorHandler(librariesHandler))
	http.HandleFunc("/switch/", errorHandler(switchHandler))
	http.HandleFunc("/deletelib", errorHandler(deletelibHandler))
}

type handlerFunc func(c *context)

// errorHandler catches errors and prints an HTTP 500 error 
func errorHandler(handler handlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		defer func() {
			if err, ok := recover().(os.Error); ok {
				w.WriteHeader(http.StatusInternalServerError)
				fmt.Fprintf(w, "%v", err)
			}
		}()
		c := newContext(w, r)
		handler(c)
	}
{'fraction_non_alphanumeric': 0.14767682746374666, 'fraction_numerical': 0.0017756732761171944, 'mean_word_length': 6.085953878406708, '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': '1652347', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1076, 'n_words': 213}