<commit_before>(ns formula1.controller
  (:require [clostache.parser :as clostache]
            [formula1.drivers :as drivers]
            [formula1.teams :as teams]
            [formula1.countries :as countries]
            [formula1.tracks :as tracks]
            [formula1.races :as races]
            [formula1.race_results :as race-results]))

(defn read-template [template-name]
  (slurp (clojure.java.io/resource
           (str "views/" template-name ".mustache"))))

(defn render-template [template-file params]
  (clostache/render (read-template template-file) params))

(defn drivers []
  (render-template "drivers" {:drivers (drivers/all)}))

(defn new []
  (render-template "new_driver" {:teams (teams/all)
                                 :countries (countries/all)}))
<commit_msg>Update controller.clj<commit_after>(ns formula1.controller
  (:require [clostache.parser :as clostache]
            [formula1.drivers :as drivers]
            [formula1.teams :as teams]
            [formula1.countries :as countries]
            [formula1.tracks :as tracks]
            [formula1.races :as races]
            [formula1.race_results :as race-results]))

(defn read-template [template-name]
  (slurp (clojure.java.io/resource
           (str "views/" template-name ".mustache"))))

(defn render-template [template-file params]
  (clostache/render (read-template template-file) params))

(defn drivers []
  (render-template "drivers" {:drivers (drivers/all)}))

(defn index []
  (render-template "index" {}))

(defn new []
  (render-template "new_driver" {:teams (teams/all)
                                 :countries (countries/all)}))

{'fraction_non_alphanumeric': 0.13730255164034022, 'fraction_numerical': 0.00850546780072904, 'mean_word_length': 2.7346938775510203, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1655003', 'n_tokens_mistral': 547, 'n_tokens_neox': 516, 'n_words': 115}