<commit_before>class Cu.Boxable
  publishToken: (callback) ->
    if @_publishToken?
      callback @_publishToken
    else
      @exec("cat ~/box.json", {dataType: 'json'}).success (settings) ->
        @_publishToken = settings.publish_token
        callback @_publishToken

  exec: (cmd, args) ->
    # Returns an ajax object, onto which you can
    # chain .success and .error callbacks
    boxurl = "#{window.boxServer}/#{@get 'box'}"
    settings =
      url: "#{boxurl}/exec"
      type: 'POST'<commit_msg>report an error in the console if we can't parse box.json<commit_after>class Cu.Boxable
  publishToken: (callback) ->
    if @_publishToken?
      callback @_publishToken
    else
      @exec "cat ~/box.json",
        dataType: 'json'
        success: (settings) ->
          @_publishToken = settings.publish_token
          callback @_publishToken
        error: (jqXhr, textStatus, errorThrown) ->
          console.warn "Couldn't parse box.json!", errorThrown


  exec: (cmd, args) ->
    # Returns an ajax object, onto which you can
    # chain .success and .error callbacks
    boxurl = "#{window.boxServer}/#{@get 'box'}"
    settings =
      url: "#{boxurl}/exec"
      type: 'POST'
{'fraction_non_alphanumeric': 0.12801330008312553, 'fraction_numerical': 0.0, 'mean_word_length': 2.6819571865443423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '103937', 'n_tokens_mistral': 376, 'n_tokens_neox': 369, 'n_words': 104}