<commit_before>package main

import (
	"flag"
	"log"
	"net/http"
	"net/http/cgi"
	"os"
	"path/filepath"
)

// The built-in web server, which serves URLs under http://gateway/

var staticFilesDir = flag.String("static-files-dir", "", "path to static files for built-in web server")
var cgiBin = flag.String("cgi-bin", "", "path to CGI files for built-in web server")

func startWebServer() {
	if *staticFilesDir != "" {
		http.Handle("/", http.FileServer(http.Dir(*staticFilesDir)))
	}

	if *cgiBin != "" {
		loadCGIHandlers()
	}
}

func loadCGIHandlers() {
	dir, err := os.Open(*cgiBin)
	if err != nil {
		log.Println("Could not open CGI directory:", err)
		return
	}
	defer dir.Close()

	info, err := dir.Readdir(0)
	if err != nil {
		log.Println("Could not read CGI directory:", err)
		return
	}

	for _, fi := range info {
		if mode := fi.Mode(); (mode&os.ModeType == 0) && (mode.Perm()&0100 != 0) {
			// It's an executable file.
			name := "/" + fi.Name()
			scriptPath := filepath.Join(*cgiBin, fi.Name())
			http.Handle(name, &cgi.Handler{
				Path: scriptPath,
			})
		}
	}
}
<commit_msg>Fix out-of-date comment about webserver.<commit_after>package main

import (
	"flag"
	"log"
	"net/http"
	"net/http/cgi"
	"os"
	"path/filepath"
)

// The built-in web server, which serves URLs under http://203.0.113.1/

var staticFilesDir = flag.String("static-files-dir", "", "path to static files for built-in web server")
var cgiBin = flag.String("cgi-bin", "", "path to CGI files for built-in web server")

func startWebServer() {
	if *staticFilesDir != "" {
		http.Handle("/", http.FileServer(http.Dir(*staticFilesDir)))
	}

	if *cgiBin != "" {
		loadCGIHandlers()
	}
}

func loadCGIHandlers() {
	dir, err := os.Open(*cgiBin)
	if err != nil {
		log.Println("Could not open CGI directory:", err)
		return
	}
	defer dir.Close()

	info, err := dir.Readdir(0)
	if err != nil {
		log.Println("Could not read CGI directory:", err)
		return
	}

	for _, fi := range info {
		if mode := fi.Mode(); (mode&os.ModeType == 0) && (mode.Perm()&0100 != 0) {
			// It's an executable file.
			name := "/" + fi.Name()
			scriptPath := filepath.Join(*cgiBin, fi.Name())
			http.Handle(name, &cgi.Handler{
				Path: scriptPath,
			})
		}
	}
}

{'fraction_non_alphanumeric': 0.17903733693207377, 'fraction_numerical': 0.009896536212325686, 'mean_word_length': 3.4214711729622267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '7505009', 'n_tokens_mistral': 907, 'n_tokens_neox': 824, 'n_words': 210}