<commit_before>package main

import (
	"flag"
	"log"
	"net/http"
	"strings"

	"github.com/ecix/birdwatcher/bird"
	"github.com/ecix/birdwatcher/endpoints"

	"github.com/julienschmidt/httprouter"
)

//go:generate versionize
var VERSION = "1.8.5"

func isModuleEnabled(module string, modulesEnabled []string) bool {
	for _, enabled := range modulesEnabled {
		if enabled == module {
			return true
		}
	}
	return false
}

func makeRouter(config endpoints.ServerConfig) *httprouter.Router {
	whitelist := config.ModulesEnabled

	r := httprouter.New()
	if isModuleEnabled("status", whitelist) {
		r.GET("/version", endpoints.Version(VERSION))
		r.GET("/status", endpoints.Endpoint(endpoints.Status))
	}
	if isModuleEnabled("protocols", whitelist) {
		r.GET("/protocols", endpoints.Endpoint(endpoints.Protocols))
	}
	if isModuleEnabled("protocols_bgp", whitelist) {
		r.GET("/protocols/bgp", endpoints.Endpoint(endpoints.Bgp))
	}
	if isModuleEnabled("symbols", whitelist) {
		r.GET("/symbols", endpoints.Endpoint(endpoints.Symbols))
	}
	if isModuleEnabled("symbols_tables", whitelist) {
		r.GET("/symbols/tables", endpoints.Endpoint(endpoints.SymbolTables))<commit_msg>versionbump<commit_after>package main

import (
	"flag"
	"log"
	"net/http"
	"strings"

	"github.com/ecix/birdwatcher/bird"
	"github.com/ecix/birdwatcher/endpoints"

	"github.com/julienschmidt/httprouter"
)

//go:generate versionize
var VERSION = "1.9.1"

func isModuleEnabled(module string, modulesEnabled []string) bool {
	for _, enabled := range modulesEnabled {
		if enabled == module {
			return true
		}
	}
	return false
}

func makeRouter(config endpoints.ServerConfig) *httprouter.Router {
	whitelist := config.ModulesEnabled

	r := httprouter.New()
	if isModuleEnabled("status", whitelist) {
		r.GET("/version", endpoints.Version(VERSION))
		r.GET("/status", endpoints.Endpoint(endpoints.Status))
	}
	if isModuleEnabled("protocols", whitelist) {
		r.GET("/protocols", endpoints.Endpoint(endpoints.Protocols))
	}
	if isModuleEnabled("protocols_bgp", whitelist) {
		r.GET("/protocols/bgp", endpoints.Endpoint(endpoints.Bgp))
	}
	if isModuleEnabled("symbols", whitelist) {
		r.GET("/symbols", endpoints.Endpoint(endpoints.Symbols))
	}
	if isModuleEnabled("symbols_tables", whitelist) {
		r.GET("/symbols/tables", endpoints.Endpoint(endpoints.SymbolTables))
{'fraction_non_alphanumeric': 0.14629948364888123, 'fraction_numerical': 0.0025817555938037868, 'mean_word_length': 5.36986301369863, 'pattern_counts': {'":': 0, '<': 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': '2703401', 'n_tokens_mistral': 835, 'n_tokens_neox': 794, 'n_words': 133}