<commit_before>(ns celestial.fixtures.populate
  "data population"
  (:require
    [simple-check.generators :as g]
    [celestial.redis :refer (clear-all)]  
    [celestial.persistency :as p]  
    [celestial.persistency.systems :as s]
    [celestial.persistency.actions :as a]
    [celestial.fixtures.data :refer (admin ronen) :as d]))

(defn add-users 
  "populates admin and ronen users" 
  []
  (p/add-user admin)
  (p/add-user ronen))

(defn add-types 
   "populates types" 
   []
  (p/add-type d/redis-type))

(defn add-actions 
   "populates actions" 
   []
  (a/add-action d/redis-deploy))

(def env-gen (g/elements [:dev :qa :prod])) 

(def systems-gen 
  (g/bind env-gen 
    (fn [v] 
      (g/fmap #(assoc % :env v) (g/elements [d/redis-prox-spec d/redis-ec2-spec])))))

(defn add-systems []
  (doseq [s (g/sample systems-gen 100)] 
    (s/add-system s)))

(defn populate-all 
   "populates all data types" 
   []
   (clear-all)
   (add-users)
   (add-types)
   (add-actions)
   (add-systems))

(defn populate-system 
   "Adds single type and system" 
   [t s]
  (clear-all)
  (p/add-type t)
  (s/add-system s))
<commit_msg>adding users as well<commit_after>(ns celestial.fixtures.populate
  "data population"
  (:require
    [simple-check.generators :as g]
    [celestial.redis :refer (clear-all)]  
    [celestial.persistency :as p]  
    [celestial.persistency.systems :as s]
    [celestial.persistency.actions :as a]
    [celestial.fixtures.data :refer (admin ronen) :as d]))

(defn add-users 
  "populates admin and ronen users" 
  []
  (p/add-user admin)
  (p/add-user ronen))

(defn add-types 
   "populates types" 
   []
  (p/add-type d/redis-type))

(defn add-actions 
   "populates actions" 
   []
  (a/add-action d/redis-deploy))

(def env-gen (g/elements [:dev :qa :prod])) 

(def systems-gen 
  (g/bind env-gen 
    (fn [v] 
      (g/fmap #(assoc % :env v) (g/elements [d/redis-prox-spec d/redis-ec2-spec])))))

(defn add-systems []
  (doseq [s (g/sample systems-gen 100)] 
    (s/add-system s)))

(defn populate-all 
   "populates all data types" 
   []
   (clear-all)
   (add-users)
   (add-types)
   (add-actions)
   (add-systems))

(defn populate-system 
   "Adds single type and system" 
   [t s]
  (clear-all)
  (add-users)
  (p/add-type t)
  (s/add-system s))

{'fraction_non_alphanumeric': 0.1628109995635094, 'fraction_numerical': 0.003491924923614142, 'mean_word_length': 2.82, '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': '2632110', 'n_tokens_mistral': 985, 'n_tokens_neox': 924, 'n_words': 208}