<commit_before>(ns user
  (:require [alembic.still :refer [distill]]
            [clojure.string :as str]
            [clojure.pprint :refer [pprint]]
            [clojure.repl :refer :all]
            [clojure.tools.namespace.repl :refer [refresh refresh-all set-refresh-dirs]]
            [environ.core :refer [env]]
            [cfpb.qu.main :as main]
            [cfpb.qu.data :as data :refer [ensure-mongo-connection]]
            [cfpb.qu.loader :as loader :refer [load-dataset]]))

(set-refresh-dirs "src/" "dev/")

(def server (atom nil))

(defn stop-server
  []
  (if @server
    (@server)))

(defn start-server
  []
  (stop-server)
  (reset! server (main/-main)))<commit_msg>Added testing functions to user ns<commit_after>(ns user
  (:require [alembic.still :refer [distill]]
            [clojure.string :as str]
            [clojure.pprint :refer [pprint]]
            [clojure.repl :refer :all]
            [clojure.test :as test]
            [clojure.tools.namespace.find :refer [find-namespaces-in-dir]]
            [clojure.java.io :refer [as-file]]
            [clojure.tools.namespace.repl :refer [refresh refresh-all set-refresh-dirs]]
            [environ.core :refer [env]]
            [cfpb.qu.main :as main]
            [cfpb.qu.data :as data :refer [ensure-mongo-connection]]
            [cfpb.qu.loader :as loader :refer [load-dataset]]))

(set-refresh-dirs "src/" "dev/" "test/")

(defn load-tests
  []
  (doseq [namespace (find-namespaces-in-dir (as-file "test"))]
    (require namespace)))

(defn run-unit-tests
  []
  (refresh)
  (apply test/run-tests (remove (fn [namespace] (:integration (meta namespace))) (all-ns))))

(defn run-all-tests
  []
  (refresh)
  (test/run-all-tests))

(def server (atom nil))

(defn stop-server
  []
  (if @server
    (@server)))

(defn start-server
  []
  (stop-server)
  (reset! server (main/-main)))
{'fraction_non_alphanumeric': 0.1642512077294686, 'fraction_numerical': 0.0, 'mean_word_length': 2.5236294896030245, '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': '3980986', 'n_tokens_mistral': 668, 'n_tokens_neox': 670, 'n_words': 147}