<commit_before>(defn- createServer
      [http Tuple2 Task]
  (fn [address] (let
    [send (:_0 address)
     server (.createServer http (fn [request response]
      (.perform Task (send (Tuple2 request response)))))]

    (.asyncFunction Task
      (fn [callback] (callback (.succeed Task server)))))))

(defn- sanitize
  [record & spaces]
  (spaces.reduce (fn [r space] (do
    (if (aget r space) nil (set! (aget r space) {}))
    (aget r space)))
  record))

(defn- listen
  [Task]
  (fn [port echo server]
    (.asyncFunction Task (fn [callback]
      (.listen server port (fn []
        (do (.log console echo) (callback (.succeed Task server)))))))))

(defn- writeHead
  [Task]
  (fn [code header res]
    (let [o {}]
      (.asyncFunction Task (fn [callback]
        (do (set! (aget o header._0) header._1)
            (.writeHead res code o)
            (callback (.succeed Task res))))))))

(defn- write
  [Task]
  (fn [message res]
    (.asyncFunction Task (fn [callback]
      (do (.write res message)
          (callback (.succeed Task res)))))))

(defn- end
  [Task Tuple0]
  (fn [res]
  (.asyncFunction Task (fn [callback]
    (do (.end res)
        (callback (.succeed Task Tuple0)))))))

(defn- make
  [localRuntime] (let
  [http (require "http")
   Task            (Elm.Native.Task.make   localRuntime)
   Utils           (Elm.Native.Utils.make  localRuntime)
   Tuple0          (:Tuple0 Utils)
   Tuple2          (:Tuple2 Utils)
   noop            (fn [] nil)]

  (do (sanitize localRuntime :Native :Http)
    (let [v localRuntime.Native.Http.values]
      (if v v (set! localRuntime.Native.Http.values {
        :createServer (createServer http Tuple2 Task)
        :listen       (F3 (listen Task))
        :writeHead    (F3 (writeHead Task))
        :write        (F2 (write Task))
        :end          (end Task Tuple0)
        :url          (fn [res] (:url res))
        :method       (fn [res] (:method res))
        :statusCode   (fn [res] (:statusCode res))
        :emptyReq     {}
        :emptyRes     {
          :end          noop
          :write        noop
          :writeHead    noop}}))))))

(sanitize Elm :Native :Http)
(set! Elm.Native.Http.make make)

(if (== (typeof window) :undefined) (set! window global))
<commit_msg>re-re-order<commit_after>(defn- sanitize
  [record & spaces]
  (spaces.reduce (fn [r space] (do
    (if (aget r space) nil (set! (aget r space) {}))
    (aget r space)))
  record))

(defn- createServer
      [http Tuple2 Task]
  (fn [address] (let
    [send (:_0 address)
     server (.createServer http (fn [request response]
      (.perform Task (send (Tuple2 request response)))))]

    (.asyncFunction Task
      (fn [callback] (callback (.succeed Task server)))))))

(defn- listen
  [Task]
  (fn [port echo server]
    (.asyncFunction Task (fn [callback]
      (.listen server port (fn []
        (do (.log console echo) (callback (.succeed Task server)))))))))

(defn- writeHead
  [Task]
  (fn [code header res]
    (let [o {}]
      (.asyncFunction Task (fn [callback]
        (do (set! (aget o header._0) header._1)
            (.writeHead res code o)
            (callback (.succeed Task res))))))))

(defn- write
  [Task]
  (fn [message res]
    (.asyncFunction Task (fn [callback]
      (do (.write res message)
          (callback (.succeed Task res)))))))

(defn- end
  [Task Tuple0]
  (fn [res]
  (.asyncFunction Task (fn [callback]
    (do (.end res)
        (callback (.succeed Task Tuple0)))))))

(defn- make
  [localRuntime] (let
  [http (require "http")
   Task            (Elm.Native.Task.make   localRuntime)
   Utils           (Elm.Native.Utils.make  localRuntime)
   Tuple0          (:Tuple0 Utils)
   Tuple2          (:Tuple2 Utils)
   noop            (fn [] nil)]

  (do (sanitize localRuntime :Native :Http)
    (let [v localRuntime.Native.Http.values]
      (if v v (set! localRuntime.Native.Http.values {
        :createServer (createServer http Tuple2 Task)
        :listen       (F3 (listen Task))
        :writeHead    (F3 (writeHead Task))
        :write        (F2 (write Task))
        :end          (end Task Tuple0)
        :url          (fn [res] (:url res))
        :method       (fn [res] (:method res))
        :statusCode   (fn [res] (:statusCode res))
        :emptyReq     {}
        :emptyRes     {
          :end          noop
          :write        noop
          :writeHead    noop}}))))))

(sanitize Elm :Native :Http)
(set! Elm.Native.Http.make make)

(if (== (typeof window) :undefined) (set! window global))

{'fraction_non_alphanumeric': 0.145953118089341, 'fraction_numerical': 0.007076514816452897, 'mean_word_length': 2.16958654519972, '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': '6852238', 'n_tokens_mistral': 1525, 'n_tokens_neox': 1454, 'n_words': 462}