<commit_before>(ns circle.models.node
  (:use [circle.utils.args :only (require-args)])
  (:use [circle.utils.validation :only (defn-v)])
  (:use [circle.utils.model-validation :only (validate!)])
  (:use [circle.utils.model-validation-helpers :only (require-keys key-types)])
  (:require [somnium.congomongo :as mongo]))

(def node-validation [(require-keys [:name :ami :username :keypair-name :public-key :private-key])
                      (key-types {:name String})])

(defn node [& {:keys [name  ;; string
                      owner ;; project-id
                      ami
                      instance-type
                      security-groups
                      availability-zone
                      username
                      keypair-name
                      public-key
                      private-key]
               :as args}]
  (validate! node-validation args))

(defn-v insert! [^::Node node]
  (mongo/insert! :nodes node))

<commit_msg>Hook up node to the validation MM<commit_after>(ns circle.models.node
  (:use [circle.utils.args :only (require-args)])
  (:use [circle.utils.validation :only (validate defn-v)])
  (:use [circle.utils.model-validation :only (validate!)])
  (:use [circle.utils.model-validation-helpers :only (require-keys key-types)])
  (:require [somnium.congomongo :as mongo]))

(def node-validation [(require-keys [:name :ami :username :keypair-name :public-key :private-key])
                      (key-types {:name String})])

(defmethod validate ::Node [tag obj]
  (validate! node-validation obj))

(defn node [& {:keys [name  ;; string
                      owner ;; project-id
                      ami
                      instance-type
                      security-groups
                      availability-zone
                      username
                      keypair-name
                      public-key
                      private-key]
               :as args}]
  (validate! node-validation args))

(defn-v insert! [^::Node node]
  (mongo/insert! :nodes node))


{'fraction_non_alphanumeric': 0.12979351032448377, 'fraction_numerical': 0.0, 'mean_word_length': 1.803030303030303, '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': '1974691', 'n_tokens_mistral': 595, 'n_tokens_neox': 546, 'n_words': 139}