<commit_before>(ns play-clj.core
  (:require [play-clj.utils :as utils])
  (:import [com.badlogic.gdx Game Gdx Input$Keys Screen]
           [com.badlogic.gdx.graphics Camera Color GL20 OrthographicCamera
            PerspectiveCamera Texture]
           [com.badlogic.gdx.graphics.g2d Animation SpriteBatch TextureRegion]
           [com.badlogic.gdx.maps MapLayer MapLayers]
           [com.badlogic.gdx.maps.tiled TiledMap TiledMapTileLayer TmxMapLoader]
           [com.badlogic.gdx.maps.tiled.renderers
            BatchTiledMapRenderer
            HexagonalTiledMapRenderer
            IsometricStaggeredTiledMapRenderer
            IsometricTiledMapRenderer
            OrthogonalTiledMapRenderer]
           [com.badlogic.gdx.scenes.scene2d Actor Stage]))

(load "core_2d")
(load "core_global")
(load "core_render")

(defn- dummy [& args])

(defn defscreen*
  [{:keys [on-show on-render on-hide on-pause on-resize on-resume]
    :or {on-show dummy on-render dummy on-hide dummy
         on-pause dummy on-resize dummy on-resume dummy}}]
  (let [screen (atom {})
        entities (atom '())
        execute (fn [func screen-map]
                  (some->> (func screen-map @entities)
                           list
                           flatten
                           (remove nil?)
                           (reset! entities)))
        create-renderer-fn! #(swap! screen assoc :renderer (renderer %))
        create-camera-fn! #(swap! screen assoc :camera (camera %))]
    (proxy [Screen] []
      (show []
        (->> (swap! screen assoc
                    :total-time 0
                    :delta-time 0
                    :create-renderer create-renderer-fn!
                    :create-camera create-camera-fn!)
             (execute on-show)))
      (render [delta-time]
        (->> (swap! screen (fn [val]
                             (assoc val
                                    :total-time (+ (:total-time val) delta-time)
                                    :delta-time delta-time)))
             (execute on-render)))
      (hide [] (execute on-hide @screen))
      (pause [] (execute on-pause @screen))
      (resize [w h] (execute on-resize @screen))
      (resume [] (execute on-resume @screen)))))
<commit_msg>Add bang to function<commit_after>(ns play-clj.core
  (:require [play-clj.utils :as utils])
  (:import [com.badlogic.gdx Game Gdx Input$Keys Screen]
           [com.badlogic.gdx.graphics Camera Color GL20 OrthographicCamera
            PerspectiveCamera Texture]
           [com.badlogic.gdx.graphics.g2d Animation SpriteBatch TextureRegion]
           [com.badlogic.gdx.maps MapLayer MapLayers]
           [com.badlogic.gdx.maps.tiled TiledMap TiledMapTileLayer TmxMapLoader]
           [com.badlogic.gdx.maps.tiled.renderers
            BatchTiledMapRenderer
            HexagonalTiledMapRenderer
            IsometricStaggeredTiledMapRenderer
            IsometricTiledMapRenderer
            OrthogonalTiledMapRenderer]
           [com.badlogic.gdx.scenes.scene2d Actor Stage]))

(load "core_2d")
(load "core_global")
(load "core_render")

(defn- dummy [& args])

(defn defscreen*
  [{:keys [on-show on-render on-hide on-pause on-resize on-resume]
    :or {on-show dummy on-render dummy on-hide dummy
         on-pause dummy on-resize dummy on-resume dummy}}]
  (let [screen (atom {})
        entities (atom '())
        execute-fn! (fn [func screen-map]
                      (some->> (func screen-map @entities)
                               list
                               flatten
                               (remove nil?)
                               (reset! entities)))
        create-renderer-fn! #(swap! screen assoc :renderer (renderer %))
        create-camera-fn! #(swap! screen assoc :camera (camera %))]
    (proxy [Screen] []
      (show []
        (->> (swap! screen assoc
                    :total-time 0
                    :delta-time 0
                    :create-renderer create-renderer-fn!
                    :create-camera create-camera-fn!)
             (execute-fn! on-show)))
      (render [delta-time]
        (->> (swap! screen (fn [val]
                             (assoc val
                                    :total-time (+ (:total-time val) delta-time)
                                    :delta-time delta-time)))
             (execute-fn! on-render)))
      (hide [] (execute-fn! on-hide @screen))
      (pause [] (execute-fn! on-pause @screen))
      (resize [w h] (execute-fn! on-resize @screen))
      (resume [] (execute-fn! on-resume @screen)))))

{'fraction_non_alphanumeric': 0.11645792133597012, 'fraction_numerical': 0.0030762469786860033, 'mean_word_length': 1.7306538692261548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1838430', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1318, 'n_words': 305}