<commit_before>(ns mikron.runtime.processor.validate
  (:require [mikron.runtime.math :as math]
            [mikron.runtime.processor.validate-macros :refer [valid-integer?]]))

(defn valid-byte?
  "Returns `true` if `value` is a valid byte."
  [value]
  (valid-integer? value 1 true))

(defn valid-ubyte?
  "Returns `true` if `value` is a valid ubyte."
  [value]
  (valid-integer? value 1 false))

(defn valid-short?
  "Returns `true` if `value` is a valid short."
  [value]
  (valid-integer? value 2 true))

(defn valid-ushort?
  "Returns `true` if `value` is a valid ushort."
  [value]
  (valid-integer? value 2 false))

(defn valid-int?
  "Returns `true` if `value` is a valid int."
  [value]
  (valid-integer? value 4 true))

(defn valid-uint?
  "Returns `true` if `value` is a valid uint."
  [value]
  (valid-integer? value 4 false))

(defn valid-long?
  "Returns `true` if `value` is a valid long."
  [value]
  (valid-integer? value 8 true))

(defn valid-binary?
  "Returns `true` if `value` is a binary value, `false` otherwise."
  [value]
  #?(:clj  (bytes? value)
     :cljs (instance? js/ArrayBuffer value)))<commit_msg>Add `:inline` to `valid-binary?`<commit_after>(ns mikron.runtime.processor.validate
  (:require [mikron.runtime.math :as math]
            [mikron.runtime.processor.validate-macros :refer [valid-integer?]]))

(defn valid-byte?
  "Returns `true` if `value` is a valid byte."
  [value]
  (valid-integer? value 1 true))

(defn valid-ubyte?
  "Returns `true` if `value` is a valid ubyte."
  [value]
  (valid-integer? value 1 false))

(defn valid-short?
  "Returns `true` if `value` is a valid short."
  [value]
  (valid-integer? value 2 true))

(defn valid-ushort?
  "Returns `true` if `value` is a valid ushort."
  [value]
  (valid-integer? value 2 false))

(defn valid-int?
  "Returns `true` if `value` is a valid int."
  [value]
  (valid-integer? value 4 true))

(defn valid-uint?
  "Returns `true` if `value` is a valid uint."
  [value]
  (valid-integer? value 4 false))

(defn valid-long?
  "Returns `true` if `value` is a valid long."
  [value]
  (valid-integer? value 8 true))

(defn valid-binary?
  "Returns `true` if `value` is a binary value, `false` otherwise."
  #?(:clj {:inline (fn [value] `(bytes? ~value))})
  [value]
  #?(:clj  (bytes? value)
     :cljs (instance? js/ArrayBuffer value)))
{'fraction_non_alphanumeric': 0.16037735849056603, 'fraction_numerical': 0.006003430531732418, 'mean_word_length': 3.6753507014028055, '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': '1208334', 'n_tokens_mistral': 877, 'n_tokens_neox': 863, 'n_words': 276}