<commit_before>package main

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

func handle(w http.ResponseWriter, r *http.Request) {
	resp := fmt.Sprintf("%+v\n", r)
	log.Println(resp)
	io.WriteString(w, resp)
}

func main() {
	http.HandleFunc("/", handle)
	log.Println("Starting httplog server at 127.0.0.1:8000")
	http.ListenAndServe(":8000", nil)
}<commit_msg>signal handling<commit_after>package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"os/signal"
	"syscall"
)

func handle(w http.ResponseWriter, r *http.Request) {
	resp := fmt.Sprintf("%+v\n", r)
	log.Println(resp)
	io.WriteString(w, resp)
}

func main() {
	http.HandleFunc("/", handle)

	go func() {
		log.Println("Starting httplog server at 127.0.0.1:8000")
		log.Fatal(http.ListenAndServe(":8000", nil))
	}()

	// Handle SIGINT and SIGTERM.
	ch := make(chan os.Signal)
	signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
	log.Println(<-ch)
}
{'fraction_non_alphanumeric': 0.18701870187018702, 'fraction_numerical': 0.030803080308030802, 'mean_word_length': 4.352941176470588, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2151418', 'n_tokens_mistral': 412, 'n_tokens_neox': 378, 'n_words': 75}