<commit_before># Initialize the main Kona object, as well as a few miscellaneous helper functions


# Set the main object on the window
Kona = window.Kona = {}

# Set this to true to log info to the console
# Make sure to disable for production dists
Kona.debugMode = true
Kona.debug  = (obj) -> console.log(obj) if Kona.debugMode
window.puts = (obj) -> Kona.debug obj


Kona.readyCallbacks = []
Kona.isReady = false

# Invoke a callback function when the document has fully loaded. Can be invoked
# multiple times - callbacks will be pushed onto a list
#
# Ex:
#
#     Kona.ready ->
#       console.log "Ready to go!"
Kona.ready = (callback) ->
  if document.readyState == 'complete'
    Kona.isReady = true

  # If the DOM is already ready, just invoke the callback.
  if Kona.isReady
    callback.call()

  Kona.readyCallbacks.push(callback)


# Internal function hooked to the DOM's ready event. Do nothing if already ready
Kona.DOMContentLoaded = ->
  return if Kona.isReady
  Kona.isReady = true
  for callback in Kona.readyCallbacks
    callback.call()

# Hook the various DOM loaded events. Borrowed from jQuery's implementation.
if document.readyState != 'complete'
  if document.addEventListener
    document.addEventListener('DOMContentLoaded', Kona.DOMContentLoaded, false)
    window.addEventListener('load', Kona.DOMContentLoaded, false)

  else if document.attachEvent
    document.attachEvent('onreadystatechange', Kona.DOMContentLoaded)
    window.attachEvent('onload', Kona.DOMContentLoaded)
<commit_msg>Sweet ASCII logo<commit_after>#    _  __                                _
#   | |/ /   ___    _ __     __ _        (_)  ___
#   | ' /   / _ \  | '_ \   / _` |       | | / __|
#   | . \  | (_) | | | | | | (_| |  _    | | \__ \
#   |_|\_\  \___/  |_| |_|  \__,_| (_)  _/ | |___/
#                                      |__/
#
#
#   https://github.com/andrewberls/kona
#
#
# Set the main object on the window
Kona = window.Kona = {}

# Set this to true to log info to the console
# Make sure to disable for production dists
Kona.debugMode = true
Kona.debug  = (obj) -> console.log(obj) if Kona.debugMode
window.puts = (obj) -> Kona.debug obj


Kona.readyCallbacks = []
Kona.isReady = false

# Invoke a callback function when the document has fully loaded. Can be invoked
# multiple times - callbacks will be pushed onto a list
#
# Ex:
#
#     Kona.ready ->
#       console.log "Ready to go!"
Kona.ready = (callback) ->
  if document.readyState == 'complete'
    Kona.isReady = true

  # If the DOM is already ready, just invoke the callback.
  if Kona.isReady
    callback.call()

  Kona.readyCallbacks.push(callback)


# Internal function hooked to the DOM's ready event. Do nothing if already ready
Kona.DOMContentLoaded = ->
  return if Kona.isReady
  Kona.isReady = true
  for callback in Kona.readyCallbacks
    callback.call()

# Hook the various DOM loaded events. Borrowed from jQuery's implementation.
if document.readyState != 'complete'
  if document.addEventListener
    document.addEventListener('DOMContentLoaded', Kona.DOMContentLoaded, false)
    window.addEventListener('load', Kona.DOMContentLoaded, false)

  else if document.attachEvent
    document.attachEvent('onreadystatechange', Kona.DOMContentLoaded)
    window.attachEvent('onload', Kona.DOMContentLoaded)

{'fraction_non_alphanumeric': 0.10421084519842472, 'fraction_numerical': 0.0, 'mean_word_length': 3.096774193548387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2920357', 'n_tokens_mistral': 1031, 'n_tokens_neox': 1003, 'n_words': 300}