<commit_before>package clix

import (
	"fmt"
	"net/http"
	"net/http/pprof"
	"time"

	"github.com/urfave/cli"
)

var ProfilerServer = &http.Server{
	ReadTimeout:  time.Minute,
	WriteTimeout: time.Minute,
}

func RunProfiler(c *cli.Context) {
	runProfiler(c)
}

func runProfiler(c Ctx) {
	if !c.Bool(FlagProfiler) {
		return
	}

	ProfilerServer.Handler = makeProfilerMux()
	ProfilerServer.Addr = fmt.Sprintf(":%s", c.String(FlagProfilerPort))

	go func() {
		err := ProfilerServer.ListenAndServe()
		if err != nil && err != http.ErrServerClosed {
			panic(err)
		}
	}()
}

func makeProfilerMux() http.Handler {
	mux := &http.ServeMux{}

	mux.HandleFunc("/debug/pprof/", pprof.Index)
	mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
	mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
	mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
	mux.HandleFunc("/debug/pprof/trace", pprof.Trace)

	return mux
}<commit_msg>Added a missing return value (error) (#14)<commit_after>package clix

import (
	"fmt"
	"net/http"
	"net/http/pprof"
	"time"

	"github.com/urfave/cli"
)

var ProfilerServer = &http.Server{
	ReadTimeout:  time.Minute,
	WriteTimeout: time.Minute,
}

func RunProfiler(c *cli.Context) error {
	runProfiler(c)
	return nil
}

func runProfiler(c Ctx) {
	if !c.Bool(FlagProfiler) {
		return
	}

	ProfilerServer.Handler = makeProfilerMux()
	ProfilerServer.Addr = fmt.Sprintf(":%s", c.String(FlagProfilerPort))

	go func() {
		err := ProfilerServer.ListenAndServe()
		if err != nil && err != http.ErrServerClosed {
			panic(err)
		}
	}()
}

func makeProfilerMux() http.Handler {
	mux := &http.ServeMux{}

	mux.HandleFunc("/debug/pprof/", pprof.Index)
	mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
	mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
	mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
	mux.HandleFunc("/debug/pprof/trace", pprof.Trace)

	return mux
}
{'fraction_non_alphanumeric': 0.16146109052408683, 'fraction_numerical': 0.0010587612493382743, 'mean_word_length': 4.510204081632653, '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': '4641319', 'n_tokens_mistral': 778, 'n_tokens_neox': 773, 'n_words': 123}