<commit_before><- $ # wait for dom load

# set global log fn. We can't just set window.log = console.log because we'll get
# 'illegal invocation' errors, since console.log expects 'this' to be console.
window.log = -> console.log ...&

pid = _.trim window.location.pathname, '/'
return $ \#output .text "Please specify pivot-id in the url e.g. /example" unless pid.length
$.ajax "/api/#pid" error:render-error, success:render, timeout:5000ms

function render-error xhr, status, msg
  $ \#output .text "An error occurred when calling the server: #msg"

function render
  is-init    = true
  dateFormat = $.pivotUtilities.derivers.dateFormat
  sortAs     = $.pivotUtilities.sortAs

  $.pivotUtilities.renderers <<< $.pivotUtilities.subtotal_renderers
  $.pivotUtilities.renderers <<< $.pivotUtilities.plotly_renderers
  $.pivotUtilities.renderers <<< $.pivotUtilities.c3_renderers
  $.pivotUtilities.renderers <<< $.pivotUtilities.d3_renderers

  $ \#output .pivotUI it.transactions, (it.config.options or {}) <<< do
    dataClass: $.pivotUtilities.SubtotalPivotData
    derivedAttributes:
      Year : dateFormat \Date '%y'
      Month: dateFormat \Date '%n'
      Day  : dateFormat \Date '%d'
    hiddenAttributes: <[ Date ]>
    onRefresh: ->
      return is-init := false if is-init<commit_msg>increase timeout to 10s<commit_after><- $ # wait for dom load

# set global log fn. We can't just set window.log = console.log because we'll get
# 'illegal invocation' errors, since console.log expects 'this' to be console.
window.log = -> console.log ...&

pid = _.trim window.location.pathname, '/'
return $ \#output .text "Please specify pivot-id in the url e.g. /example" unless pid.length
$.ajax "/api/#pid" error:render-error, success:render, timeout:10000ms

function render-error xhr, status, msg
  $ \#output .text "An error occurred when calling the server: #msg"

function render
  is-init    = true
  dateFormat = $.pivotUtilities.derivers.dateFormat
  sortAs     = $.pivotUtilities.sortAs

  $.pivotUtilities.renderers <<< $.pivotUtilities.subtotal_renderers
  $.pivotUtilities.renderers <<< $.pivotUtilities.plotly_renderers
  $.pivotUtilities.renderers <<< $.pivotUtilities.c3_renderers
  $.pivotUtilities.renderers <<< $.pivotUtilities.d3_renderers

  $ \#output .pivotUI it.transactions, (it.config.options or {}) <<< do
    dataClass: $.pivotUtilities.SubtotalPivotData
    derivedAttributes:
      Year : dateFormat \Date '%y'
      Month: dateFormat \Date '%n'
      Day  : dateFormat \Date '%d'
    hiddenAttributes: <[ Date ]>
    onRefresh: ->
      return is-init := false if is-init
{'fraction_non_alphanumeric': 0.12908182865923934, 'fraction_numerical': 0.005762581636573185, 'mean_word_length': 3.700361010830325, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 9, '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': '6910754', 'n_tokens_mistral': 828, 'n_tokens_neox': 823, 'n_words': 224}