<commit_before>(ns incise.utils
  (:import [java.io File]))

(defn- gitignore-file? [^File file]
  (= (.getName file) ".gitignore"))

(defn delete-recursively
  "Delete a directory tree."
  [^File root]
  (when (.isDirectory root)
    (doseq [file (remove gitignore-file? (.listFiles root))]
      (delete-recursively file)))
  (.delete root))<commit_msg>Modify delete-recursively to fail gracefully for nil root.<commit_after>(ns incise.utils
  (:import [java.io File]))

(defn- gitignore-file? [^File file]
  (= (.getName file) ".gitignore"))

(defn delete-recursively
  "Delete a directory tree."
  [^File root]
  (when root
    (when (.isDirectory root)
      (doseq [file (remove gitignore-file? (.listFiles root))]
        (delete-recursively file)))
    (.delete root)))
{'fraction_non_alphanumeric': 0.15958815958815958, 'fraction_numerical': 0.0, 'mean_word_length': 3.802469135802469, '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': '1417839', 'n_tokens_mistral': 273, 'n_tokens_neox': 251, 'n_words': 74}