<commit_before>package main

import (
	"net/http"
	"io"
	"runtime"
	"fmt"
	"time"
	"strconv"
)


func SlowHandler(w http.ResponseWriter, req *http.Request) {
	time.Sleep(250 * time.Millisecond);
	io.WriteString(w, "hello, world!\n")
}


func FastHandler(w http.ResponseWriter, req *http.Request) {
	io.WriteString(w, "hello, world!\n")
}


func ResizeHandler(w http.ResponseWriter, req *http.Request) {
	procs, err := strconv.Atoi(req.FormValue("workers"))

	if (err != nil) {
		io.WriteString(w, "Resize did not work.  Please use '?workers=<number>'")
		return
	}

	fmt.Println("sizing to", procs, "procs...")
	fmt.Println(runtime.GOMAXPROCS(procs))
	io.WriteString(w, "Resized to " + strconv.Itoa(procs) + " procs")
}


func main() {
	numCPU := runtime.NumCPU();
	fmt.Println("number of procs:", numCPU)
	fmt.Println(runtime.GOMAXPROCS(numCPU))

	http.HandleFunc("/", SlowHandler)
	http.HandleFunc("/resize", ResizeHandler)

	http.ListenAndServe(":8081", nil)
}
<commit_msg>remove io library and use what's there<commit_after>package main

import (
	"fmt"
	"net/http"
	"runtime"
	"strconv"
	"time"
)

func SlowHandler(w http.ResponseWriter, req *http.Request) {
	time.Sleep(250 * time.Millisecond)
	fmt.Fprint(w, "hello, world!\n")
}

func FastHandler(w http.ResponseWriter, req *http.Request) {
	fmt.Fprint(w, "hello, world!\n")
}

func ResizeHandler(w http.ResponseWriter, req *http.Request) {
	procs, err := strconv.Atoi(req.FormValue("workers"))

	if err != nil {
		w.WriteHeader(http.StatusBadRequest)
		fmt.Fprint(w, "Resize did not work.  Please use '?workers=<number>'")
		return
	}

	fmt.Printf("sizing to %s procs...\n", procs)
	fmt.Println("previous number of procs used:", runtime.GOMAXPROCS(procs))
	fmt.Fprintf(w, "Resized to %d procs", strconv.Itoa(procs))
}

func main() {
	numCPU := runtime.NumCPU()
	fmt.Println("number of procs:", numCPU)
	fmt.Println(runtime.GOMAXPROCS(numCPU))

	http.HandleFunc("/", SlowHandler)
	http.HandleFunc("/resize", ResizeHandler)

	http.ListenAndServe(":8081", nil)
}

{'fraction_non_alphanumeric': 0.1694747274529237, 'fraction_numerical': 0.006937561942517344, 'mean_word_length': 4.938235294117647, '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': '3844090', 'n_tokens_mistral': 800, 'n_tokens_neox': 777, 'n_words': 157}