<commit_before>(ns org.gensym.viddy.queries.in-memory-date-cache
  (require [org.gensym.viddy.queries.date-cache :as dc]))

(defn make-datacache [calculation-fns]
  (reify dc/DateCache

    (maybe-find-for-date-range [this key start end]
      (if (contains? this [key start end])
        [true (get this [key start end])]
        [false nil]))

    (calculate-for-date-range [this key start end]
      ((get calculation-fns key) start end))


    (store-calculation [this key start end calculation]
      (assoc this [key start end] calculation))

    (concat-calculation [this a b]
      (calculation-fns key) a b)))<commit_msg>Fixing a protocol-related compile error in the in-memory-date-cache sketch<commit_after>(ns org.gensym.viddy.queries.in-memory-date-cache
  (require [org.gensym.viddy.queries.date-cache :as dc]))

(defn make-datacache [calculation-fns]
  (reify dc/DateCache

    (maybe-find-for-date-range [this key start end args]
      (if (contains? this [key start end])
        [true (get this [key start end])]
        [false nil]))

    (calculate-for-date-range [this key start end args]
      ((get calculation-fns key) start end))


    (store-calculation [this key start end calculation args]
      (assoc this [key start end] calculation))

    (concat-calculation [this key a b]
      (calculation-fns key) a b)

    (empty-calculation [datasource key]
      )))
{'fraction_non_alphanumeric': 0.1259899208063355, 'fraction_numerical': 0.0, 'mean_word_length': 3.1492537313432836, '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': '3950968', 'n_tokens_mistral': 478, 'n_tokens_neox': 452, 'n_words': 134}