<commit_before>(ns less4clj.util)

;;
;; Debugging
;; from boot.util
;;

; Hack to detect boot verbosity
(defn- get-verbosity []
  (try
    (require 'boot.util)
    ; Deref var and atom
    @@(resolve 'boot.util/*verbosity*)
    (catch Exception _
      1)))

(defn- print*
  [verbosity args]
  (when (>= (get-verbosity) verbosity)
    (binding [*out* *err*]
      (apply printf args) (flush))))

(defn dbug [& more] (print* 2 more))
(defn info [& more] (print* 1 more))
(defn warn [& more] (print* 1 more))
(defn fail [& more] (print* 1 more))<commit_msg>Add dynamic var for setting verbosity<commit_after>(ns less4clj.util)

;;
;; Debugging
;; from boot.util
;;

(def ^:dynamic *verbosity* 1)

; Hack to detect boot verbosity
(defn- get-verbosity []
  (try
    (require 'boot.util)
    ; Deref var and atom
    @@(resolve 'boot.util/*verbosity*)
    (catch Exception _
      *verbosity*)))

(defn- print*
  [verbosity args]
  (when (>= (get-verbosity) verbosity)
    (binding [*out* *err*]
      (apply printf args) (flush))))

(defn dbug [& more] (print* 2 more))
(defn info [& more] (print* 1 more))
(defn warn [& more] (print* 1 more))
(defn fail [& more] (print* 1 more))
{'fraction_non_alphanumeric': 0.1750212404418012, 'fraction_numerical': 0.010195412064570943, 'mean_word_length': 3.5134099616858236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5862268', 'n_tokens_mistral': 454, 'n_tokens_neox': 436, 'n_words': 132}