<commit_before>  /*!
  * -------------------
  * Treasure Tracker JS
  * -------------------
  */

  Treasure.prototype.addEvent = function() {
    _uploadEvent.apply(this, arguments);
  };

  Treasure.prototype.trackExternalLink = function(jsEvent, table, payload, timeout, timeoutCallback){

    var evt = jsEvent,
        newTab = evt.metaKey,
        target = evt.target,
        triggered = false,
        callback = function(){};

    if (timeout === undefined) {
      timeout = 500;
    }

    if (target.nodeName === "A") {
      callback = function(){
        if(!newTab && !triggered){
          triggered = true;
          window.location = target.href;
        }
      };
    } else if (target.nodeName === "FORM") {
      callback = function(){
        if(!triggered){
          triggered = true;
          target.submit();
        }
      };
    }

    if (timeoutCallback) {
      callback = function(){
        if(!triggered){
          triggered = true;
          timeoutCallback();
        }
      };
    }
    _uploadEvent.call(this, table, payload, callback, callback);

    setTimeout(function() {
      callback();
    }, timeout);

    if (!newTab) {
      return false;
    }
  };

  Treasure.prototype.setGlobalProperties = function(newGlobalProperties) {
    if (!this.client) {
      return Treasure.log('Check out our JavaScript SDK Usage Guide: http://docs.treasuredata.com/articles/javascript-sdk');      
    }
    if (newGlobalProperties && typeof(newGlobalProperties) === 'function') {
      this.client.globalProperties = newGlobalProperties;
    } else {
      throw new Error('Invalid value for global properties: ' + newGlobalProperties);
    }
  };

  // Private for Treasure Tracker JS
  // -------------------------------

  function _uploadEvent(table, payload, success, error) {
    if (!(/^[a-z0-9_]{3,255}$/.test(table))) {
      throw new Error('Table must be between 3 and 255 characters and must consist only of lower case letters, numbers, and _');
    }

    var url = _build_url.apply(this, ['/' + table]);
    var newEvent = {};
    var jsonBody, base64Body;
<commit_msg>refactor(track): temporarily remove trackExternalLink<commit_after>  /*!
  * -------------------
  * Treasure Tracker JS
  * -------------------
  */

  Treasure.prototype.addEvent = function() {
    _uploadEvent.apply(this, arguments);
  };

  /*
  Treasure.prototype.trackExternalLink = function(jsEvent, table, payload, timeout, timeoutCallback){

    var evt = jsEvent,
        newTab = evt.metaKey,
        target = evt.target,
        triggered = false,
        callback = function(){};

    if (timeout === undefined) {
      timeout = 500;
    }

    if (target.nodeName === "A") {
      callback = function(){
        if(!newTab && !triggered){
          triggered = true;
          window.location = target.href;
        }
      };
    } else if (target.nodeName === "FORM") {
      callback = function(){
        if(!triggered){
          triggered = true;
          target.submit();
        }
      };
    }

    if (timeoutCallback) {
      callback = function(){
        if(!triggered){
          triggered = true;
          timeoutCallback();
        }
      };
    }
    _uploadEvent.call(this, table, payload, callback, callback);

    setTimeout(function() {
      callback();
    }, timeout);

    if (!newTab) {
      return false;
    }
  };
  */

  Treasure.prototype.setGlobalProperties = function(newGlobalProperties) {
    if (!this.client) {
      return Treasure.log('Check out our JavaScript SDK Usage Guide: http://docs.treasuredata.com/articles/javascript-sdk');      
    }
    if (newGlobalProperties && typeof(newGlobalProperties) === 'function') {
      this.client.globalProperties = newGlobalProperties;
    } else {
      throw new Error('Invalid value for global properties: ' + newGlobalProperties);
    }
  };

  // Private for Treasure Tracker JS
  // -------------------------------

  function _uploadEvent(table, payload, success, error) {
    if (!(/^[a-z0-9_]{3,255}$/.test(table))) {
      throw new Error('Table must be between 3 and 255 characters and must consist only of lower case letters, numbers, and _');
    }

    var url = _build_url.apply(this, ['/' + table]);
    var newEvent = {};
    var jsonBody, base64Body;

{'fraction_non_alphanumeric': 0.16131284916201116, 'fraction_numerical': 0.006983240223463687, 'mean_word_length': 2.131924198250729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2792184', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1185, 'n_words': 283}