<commit_before>var BlockChainInfo = (function(self, $) {

  function getJSONForPath(path, hollaback) {
    var url = 'https://blockchain.info' + path;
    $.getJSON(url, { cors: 'true' }, function(data) {
      if (data) {
        hollaback(data);
      } else {
        hollaback({});
      }
    });
  }

  self.multiaddr = function(address, hollaback) {
    getJSONForPath('/multiaddr?active=' + address, hollaback);
  };

  self.unspent = function(address, hollaback) {
    getJSONForPath('/unspent?active=' + address, hollaback);
  };

  self.pushtx = function(tx, hollaback) {
    var url = 'https://blockchain.info/pushtx?cors=true',
        postData = { tx: tx };

    $.ajax({
      type: 'POST',<commit_msg>unspent returns 500 when empty. handle 500s gracefully<commit_after>var BlockChainInfo = (function(self, $) {

  function getJSONForPath(path, hollaback) {
    var url = 'https://blockchain.info' + path;
    $.ajax({
      type: 'GET',
      url: url,
      data: { cors: 'true' },
      success: function(data) {
        hollaback(data);
      },
      error: function(xhr, opt, err) {
        hollaback({});
      }
    });
  }

  self.multiaddr = function(address, hollaback) {
    getJSONForPath('/multiaddr?active=' + address, hollaback);
  };

  self.unspent = function(address, hollaback) {
    getJSONForPath('/unspent?active=' + address, hollaback);
  };

  self.pushtx = function(tx, hollaback) {
    var url = 'https://blockchain.info/pushtx?cors=true',
        postData = { tx: tx };

    $.ajax({
      type: 'POST',
{'fraction_non_alphanumeric': 0.1630012936610608, 'fraction_numerical': 0.0038809831824062097, 'mean_word_length': 2.8771929824561404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5443111', 'n_tokens_mistral': 564, 'n_tokens_neox': 551, 'n_words': 99}