<commit_before>(ns compute-clojure.compute-examples
  (:use
    [org.jclouds.compute2]
    [clojure.java.io])
  (:import
    [org.jclouds.domain LoginCredentials]
    [org.jclouds.scriptbuilder InitBuilder]
    [org.jclouds.compute.options TemplateOptions$Builder]
    [org.jclouds.scriptbuilder.domain Statement Statements]
    [org.jclouds.scriptbuilder.statements.login AdminAccess]))

(defn print-nodes-in-group [compute group]
  (let [nodes (nodes-with-details-matching compute #(= group (.getGroup %)))]
    (map #(println (format "<< node %s private ips:%s public-ips:%s%n" (.getId %) (private-ips %) (public-ips %))) nodes)))

(defn get-credentials []
  (-> (LoginCredentials/builder)
    (.user (System/getProperty "user.name"))
    (.privateKey (slurp (str (System/getProperty "user.home") "/.ssh/id_rsa") :encoding "utf-8"))))

(defn options [login]
  (-> (TemplateOptions$Builder/overrideLoginCredentials login)
    (.runAsRoot false)
    (.wrapInInitScript false)))

(defn print-exec-response [response]
  (let [node (key response)
        output (val response)]
    (println (format "<< node: %s %s %s %s%n" (.getId node) (private-ips node) (public-ips node) output))))
<commit_msg>sorted clojure syntax<commit_after>(ns compute-clojure.compute-examples
  (:use
    [org.jclouds.compute2]
    [clojure.java.io])
  (:import
    [org.jclouds.domain LoginCredentials]
    [org.jclouds.scriptbuilder InitBuilder]
    [org.jclouds.compute.options TemplateOptions$Builder]
    [org.jclouds.scriptbuilder.domain Statement Statements]
    [org.jclouds.scriptbuilder.statements.login AdminAccess]))

(defn print-nodes-in-group [compute group]
  (let [nodes (nodes-with-details-matching compute #(= group (.getGroup %)))]
    (map #(println (format "<< node %s private ips:%s public-ips:%s%n" (.getId %) (private-ips %) (public-ips %))) nodes)))

(defn get-credentials []
  (-> (LoginCredentials/builder)
    (.user (System/getProperty "user.name"))
    (.privateKey (slurp (str (System/getProperty "user.home") "/.ssh/id_rsa") :encoding "utf-8"))
    (.build)))

(defn options [login]
  (-> (TemplateOptions$Builder/overrideLoginCredentials login)
    (.runAsRoot false)
    (.wrapInInitScript false)))

(defn print-exec-response [response]
  (let [node (key response)
        output (val response)]
    (println (format "<< node: %s %s %s %s%n" (.getId node) (private-ips node) (public-ips node) output))))

{'fraction_non_alphanumeric': 0.1661831744716121, 'fraction_numerical': 0.0016576875259013675, 'mean_word_length': 4.236442516268981, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '3518634', 'n_tokens_mistral': 827, 'n_tokens_neox': 807, 'n_words': 175}