<commit_before>package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
)

func main() {
	var (
		listen = flag.String("listen", ":8082", "Address + Port to listen on. Format ip:port.")
	)
	flag.Parse()

	log.Printf("Starting webserver and listen on %s", *listen)
	http.HandleFunc("/", httpHandleRoot)
	http.HandleFunc("/ping", httpHandlePing)
	log.Fatal(http.ListenAndServe(*listen, nil))
}

func httpHandleRoot(resp http.ResponseWriter, req *http.Request) {
	http.Redirect(resp, req, "/ping", http.StatusSeeOther)
}

func httpHandlePing(resp http.ResponseWriter, req *http.Request) {
	resp.WriteHeader(http.StatusOK)
	fmt.Fprintln(resp, "pong")
}<commit_msg>Fix #2: Add version endpoint<commit_after>package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
)

const (
	Name = "simple webserver"
	Version = "0.1.0-dev"
)

func main() {
	var (
		listen = flag.String("listen", ":8082", "Address + Port to listen on. Format ip:port.")
	)
	flag.Parse()

	http.HandleFunc("/", httpHandleRoot)
	http.HandleFunc("/ping", httpHandlePing)
	http.HandleFunc("/version", VersionHandler)

	log.Printf("Starting webserver and listen on %s", *listen)
	log.Fatal(http.ListenAndServe(*listen, nil))
}

func httpHandleRoot(resp http.ResponseWriter, req *http.Request) {
	http.Redirect(resp, req, "/ping", http.StatusSeeOther)
}

func httpHandlePing(resp http.ResponseWriter, req *http.Request) {
	resp.WriteHeader(http.StatusOK)
	fmt.Fprintln(resp, "pong")
}

func VersionHandler(resp http.ResponseWriter, req *http.Request) {
	resp.WriteHeader(http.StatusOK)
	fmt.Fprintf(resp, "%s v%s", Name, Version)
}
{'fraction_non_alphanumeric': 0.15984896161107615, 'fraction_numerical': 0.007551919446192574, 'mean_word_length': 5.162790697674419, 'pattern_counts': {'":': 2, '<': 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': '4161256', 'n_tokens_mistral': 584, 'n_tokens_neox': 571, 'n_words': 125}