<commit_before>dummy = () ->

merge = (o1, o2) ->
  for own key, value of o2
    if value instanceof Object
      o1[key] = merge o1[key], value
    else
      o1[key] = value

  return o1

mustache = (a, b) ->
  a.replace /\{\{([^{}]+)\}\}/g, (c, d) ->
    if b.hasOwnProperty(d) && b[d]?
      return "#{b[d]}"
    else
      return ''

getTarget = (element, selector) ->
  return element.querySelector selector if selector
  return element

addEvent = (element, event, listener, selector) ->
  target = getTarget element, selector
  return unless target

  target.addEventListener event, listener, false
  return

classList = (element, className, selector, method) ->
  target = getTarget element, selector
  return false if not target or not target.classList
  return target.classList[method] className

addClass = (element, className, selector) ->
  classList element, className, selector, 'add'

removeClass = (element, className, selector) ->
  classList element, className, selector, 'remove'

toggleClass = (element, className, selector) ->
  classList element, className, selector, 'toggle'

hasClass = (element, className, selector) ->
  classList element, className, selector, 'contains'

getAttribute = (element, attribute) ->
  element.getAttribute attribute

getStyle = (element) ->
  style = window.getComputedStyle element
  return (property) ->
    style.getPropertyValue property

setStyle = (element, params) ->
  style = window.getComputedStyle element
  for own property, value of params
    style.setProperty property, value
  return

offsetWidth = (element) ->
  element.offsetWidth

offsetHeight = (element) ->
  element.offsetHeight

beforeEnd = (element, template) ->
  element.insertAdjacentHTML 'beforeend', template
  element.lastElementChild<commit_msg>Fixed setStyle<commit_after>dummy = () ->

merge = (o1, o2) ->
  for own key, value of o2
    if value instanceof Object
      o1[key] = merge o1[key], value
    else
      o1[key] = value

  return o1

mustache = (a, b) ->
  a.replace /\{\{([^{}]+)\}\}/g, (c, d) ->
    if b.hasOwnProperty(d) && b[d]?
      return "#{b[d]}"
    else
      return ''

getTarget = (element, selector) ->
  return element.querySelector selector if selector
  return element

addEvent = (element, event, listener, selector) ->
  target = getTarget element, selector
  return unless target

  target.addEventListener event, listener, false
  return

classList = (element, className, selector, method) ->
  target = getTarget element, selector
  return false if not target or not target.classList
  return target.classList[method] className

addClass = (element, className, selector) ->
  classList element, className, selector, 'add'

removeClass = (element, className, selector) ->
  classList element, className, selector, 'remove'

toggleClass = (element, className, selector) ->
  classList element, className, selector, 'toggle'

hasClass = (element, className, selector) ->
  classList element, className, selector, 'contains'

getAttribute = (element, attribute) ->
  element.getAttribute attribute

getStyle = (element) ->
  style = window.getComputedStyle element
  return (property) ->
    style.getPropertyValue property

setStyle = (element, params) ->
  element.style[toCamelCase property] = value for own property, value of params

toCamelCase = (str) ->
  str.replace /-([a-z])/g, (str) -> str[1].toUpperCase()

offsetWidth = (element) ->
  element.offsetWidth

offsetHeight = (element) ->
  element.offsetHeight

beforeEnd = (element, template) ->
  element.insertAdjacentHTML 'beforeend', template
  element.lastElementChild
{'fraction_non_alphanumeric': 0.12149791955617198, 'fraction_numerical': 0.004160887656033287, 'mean_word_length': 3.93296853625171, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '3693799', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1061, 'n_words': 328}