<commit_before>package main

import (
	"fmt"
	"log"
	"math/rand"
	"net/http"
	"text/template"
	"time"

	"google.golang.org/appengine"
)

type results []struct {
	Color       string
	Schema      string
	Schema2     string
	Exclamation string
	Broken      string
	Image       string
}

var (
	t    = template.Must(template.New("template").Parse(mainPage))
	data = results{{
		Color:       "red",
		Schema:      "https",
		Schema2:     "https",
		Exclamation: "NO",
		Broken:      "BROKEN",
		Image:       "no-coffee.jpg",
	}, {
		Color:       "green",
		Schema:      "https",
		Schema2:     "https",
		Exclamation: "YES",
		Broken:      "ON",
		Image:       "coffee-works.jpg",
	}}

	randPool = rand.New(rand.NewSource(time.Now().UnixNano()))
)

func main() {
	// Start the appengine main.
	http.HandleFunc("/", handle)
	http.HandleFunc("/_ah/health", healthCheckHandler)

	appengine.Main()
	log.Print("Listening on port 8777")
	log.Fatal(http.ListenAndServe(":8777", nil))
}

func handle(w http.ResponseWriter, r *http.Request) {
	// var result bytes.Buffer
	if r.URL.Path != "/" {
		http.NotFound(w, r)
		return
	}<commit_msg>Add a timing function to display generation time.<commit_after>package main

import (
	"fmt"
	"log"
	"math/rand"
	"net/http"
	"text/template"
	"time"

	"google.golang.org/appengine"
)

type results []struct {
	Color       string
	Schema      string
	Schema2     string
	Exclamation string
	Broken      string
	Image       string
}

var (
	t    = template.Must(template.New("template").Parse(mainPage))
	data = results{{
		Color:       "red",
		Schema:      "https",
		Schema2:     "https",
		Exclamation: "NO",
		Broken:      "BROKEN",
		Image:       "no-coffee.jpg",
	}, {
		Color:       "green",
		Schema:      "https",
		Schema2:     "https",
		Exclamation: "YES",
		Broken:      "ON",
		Image:       "coffee-works.jpg",
	}}

	randPool = rand.New(rand.NewSource(time.Now().UnixNano()))
)

func main() {
	// Start the appengine main.
	http.HandleFunc("/", handle)
	http.HandleFunc("/_ah/health", healthCheckHandler)

	appengine.Main()
	log.Print("Listening on port 8777")
	log.Fatal(http.ListenAndServe(":8777", nil))
}

func handle(w http.ResponseWriter, r *http.Request) {
	defer func(t time.Time) { fmt.Fprintf(w, "<address>Generated page in %s</address>", time.Since(t)) }(time.Now())
	// var result bytes.Buffer
	if r.URL.Path != "/" {
		http.NotFound(w, r)
		return
	}
{'fraction_non_alphanumeric': 0.16028309741881766, 'fraction_numerical': 0.009159034138218152, 'mean_word_length': 2.9916943521594686, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '5159163', 'n_tokens_mistral': 941, 'n_tokens_neox': 876, 'n_words': 189}