<commit_before>{
  fire, delegate
  getData, $
  refreshCSRFTokens, CSRFProtection
  enableElement, disableElement, handleDisabledElement
  handleConfirm
  handleRemote, formSubmitButtonClick, handleMetaClick
  handleMethod
} = Rails

# For backward compatibility
if jQuery? and jQuery.ajax? and not jQuery.rails
  jQuery.rails = Rails
  jQuery.ajaxPrefilter (options, originalOptions, xhr) ->
    CSRFProtection(xhr) unless options.crossDomain

Rails.start = ->
  # Cut down on the number of issues from people inadvertently including
  # rails-ujs twice by detecting and raising an error when it happens.
  throw new Error('rails-ujs has already been loaded!') if window._rails_loaded

  # This event works the same as the load event, except that it fires every
  # time the page is loaded.
  # See https://github.com/rails/jquery-ujs/issues/357
  # See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching
  window.addEventListener 'pageshow', ->
    $(Rails.formEnableSelector).forEach (el) ->
      enableElement(el) if getData(el, 'ujs:disabled')<commit_msg>Throw if ujs loaded twice<commit_after>{
  fire, delegate
  getData, $
  refreshCSRFTokens, CSRFProtection
  enableElement, disableElement, handleDisabledElement
  handleConfirm
  handleRemote, formSubmitButtonClick, handleMetaClick
  handleMethod
} = Rails

# For backward compatibility
if jQuery? and jQuery.ajax?
  throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.') if jQuery.rails
  jQuery.rails = Rails
  jQuery.ajaxPrefilter (options, originalOptions, xhr) ->
    CSRFProtection(xhr) unless options.crossDomain

Rails.start = ->
  # Cut down on the number of issues from people inadvertently including
  # rails-ujs twice by detecting and raising an error when it happens.
  throw new Error('rails-ujs has already been loaded!') if window._rails_loaded

  # This event works the same as the load event, except that it fires every
  # time the page is loaded.
  # See https://github.com/rails/jquery-ujs/issues/357
  # See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching
  window.addEventListener 'pageshow', ->
    $(Rails.formEnableSelector).forEach (el) ->
      enableElement(el) if getData(el, 'ujs:disabled')
{'fraction_non_alphanumeric': 0.08722741433021806, 'fraction_numerical': 0.004450378282153983, 'mean_word_length': 4.390887290167866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '5932965', 'n_tokens_mistral': 694, 'n_tokens_neox': 654, 'n_words': 208}