<commit_before>(ns selmer.template-parser
  " Where we preprocess the inheritance and mixin components of the templates.
  These are presumed to be static and we only aggregate them on the first
  template render. The compile-time tag parsing routines happen on a flat string
  composed from the result of `extends` inheritance and `include` mixins. "
  (:require [clojure.java.io :refer [reader]]
            [selmer.util :refer :all]
            [clojure.string :refer [split trim]]
            [selmer.validator :as validator])
  (:import [java.io File StringReader]))

(declare consume-block preprocess-template)

(defn get-tag-params [tag-id block-str]
  (-> block-str (split tag-id) second (split *tag-second-pattern*) first trim))

(defn parse-defaults [defaults]
  (when defaults
    (->> defaults
         (apply str)
         split-by-args
         (partition 2)
         (map vec)
         (into {}))))<commit_msg>fixed parsing args with spaces<commit_after>(ns selmer.template-parser
  " Where we preprocess the inheritance and mixin components of the templates.
  These are presumed to be static and we only aggregate them on the first
  template render. The compile-time tag parsing routines happen on a flat string
  composed from the result of `extends` inheritance and `include` mixins. "
  (:require [clojure.java.io :refer [reader]]
            [selmer.util :refer :all]
            [clojure.string :refer [split trim]]
            [selmer.validator :as validator])
  (:import [java.io File StringReader]))

(declare consume-block preprocess-template)

(defn get-tag-params [tag-id block-str]
  (-> block-str (split tag-id) second (split *tag-second-pattern*) first trim))

(defn parse-defaults [defaults]  
  (when defaults    
    (->> defaults
         (interpose " ")
         (apply str)
         split-by-args
         (partition 2)
         (map vec)
         (into {}))))
{'fraction_non_alphanumeric': 0.1053740779768177, 'fraction_numerical': 0.001053740779768177, 'mean_word_length': 2.915463917525773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3927253', 'n_tokens_mistral': 555, 'n_tokens_neox': 545, 'n_words': 197}