<commit_before>(ns regarde.db
  (:require [korma.db :as sql]
            [ragtime.core :refer [applied-migrations migrate-all]]
            [ragtime.sql.files]))

(defn db-name [env]
  (if-let [database-name (environ.core/env :database-name)]
    database-name
    (cond
     (= env :development) "regarde_dev"
     (= env :test) "regarde_test"
     (= env :production) "regarde_prod")))

(defn- ragtime-db-connection [env]
  (let [user (or (environ.core/env :database-user) "postgres")
        password (or (environ.core/env :database-password) "")
        host (or (environ.core/env :database-host) "localhost")
        subname (str "//" host ":5432/" (db-name env))]
    (ragtime.sql.database.SqlDatabase. {}
                                       {:classname "org.postgresql.Driver"
                                        :subprotocol "postgresql"
                                        :subname subname<commit_msg>Fix a failure in the slamhound run.<commit_after>(ns regarde.db
  (:require [korma.db :as sql]
            [ragtime.core :refer [applied-migrations migrate-all]]
            [environ.core]
            [ragtime.sql.files]))

(defn db-name [env]
  (if-let [database-name (environ.core/env :database-name)]
    database-name
    (cond
     (= env :development) "regarde_dev"
     (= env :test) "regarde_test"
     (= env :production) "regarde_prod")))

(defn- ragtime-db-connection [env]
  (let [user (or (environ.core/env :database-user) "postgres")
        password (or (environ.core/env :database-password) "")
        host (or (environ.core/env :database-host) "localhost")
        subname (str "//" host ":5432/" (db-name env))]
    (ragtime.sql.database.SqlDatabase. {}
                                       {:classname "org.postgresql.Driver"
                                        :subprotocol "postgresql"
                                        :subname subname
{'fraction_non_alphanumeric': 0.1417239555790587, 'fraction_numerical': 0.004230565838180857, 'mean_word_length': 2.0127388535031847, 'pattern_counts': {'":': 2, '<': 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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '873711', 'n_tokens_mistral': 589, 'n_tokens_neox': 586, 'n_words': 126}