<commit_before>import feature from './feature';


//  Google Analytics injection.

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
window.ga('create', 'UA-101720844-1', 'auto');
window.ga('send', 'pageview');


//  Custom Analytics
//  https://github.com/puckey/you-move-me/issues/315
//  requestIdleCallback:
//  https://developers.google.com/web/updates/2015/08/using-requestidlecallback

const verbosity = 1;


const analytics = {
  //  Super general event recording. Most stuff gets funneled through this.
  record: (obj) => {
    if (verbosity >= 0.5) console.log('Note:', obj);
    if (window.ga !== undefined && typeof window.ga === 'function') {
      const callback = () => {
        window.ga('send', obj);
        if (verbosity >= 0.5) console.log('Noted.');
      };
      if ('requestIdleCallback' in window) {
        window.requestIdleCallback(callback);
      } else {
        callback();
      }
    }
  },
  //  This is basically a “bounce” event recording.
  recordOutboundLink: (a) => {
    const url = a.getAttribute('href');
    if (verbosity >= 0.5) console.log('Note:', url);
    if (window.ga !== undefined && typeof window.ga === 'function') {
      const callback = () => {
        window.ga('send', 'event', 'outbound', 'click', url, {
          transport: 'beacon',
          hitCallback: function () {},
          //hitCallback: function(){ document.location = url }
        });<commit_msg>turn off logging<commit_after>import feature from './feature';


//  Google Analytics injection.

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
window.ga('create', 'UA-101720844-1', 'auto');
window.ga('send', 'pageview');


//  Custom Analytics
//  https://github.com/puckey/you-move-me/issues/315
//  requestIdleCallback:
//  https://developers.google.com/web/updates/2015/08/using-requestidlecallback

const verbosity = 0;


const analytics = {
  //  Super general event recording. Most stuff gets funneled through this.
  record: (obj) => {
    if (verbosity >= 0.5) console.log('Note:', obj);
    if (window.ga !== undefined && typeof window.ga === 'function') {
      const callback = () => {
        window.ga('send', obj);
        if (verbosity >= 0.5) console.log('Noted.');
      };
      if ('requestIdleCallback' in window) {
        window.requestIdleCallback(callback);
      } else {
        callback();
      }
    }
  },
  //  This is basically a “bounce” event recording.
  recordOutboundLink: (a) => {
    const url = a.getAttribute('href');
    if (verbosity >= 0.5) console.log('Note:', url);
    if (window.ga !== undefined && typeof window.ga === 'function') {
      const callback = () => {
        window.ga('send', 'event', 'outbound', 'click', url, {
          transport: 'beacon',
          hitCallback: function () {},
          //hitCallback: function(){ document.location = url }
        });
{'fraction_non_alphanumeric': 0.19958787165145717, 'fraction_numerical': 0.017073888725345893, 'mean_word_length': 3.2742138364779874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '7021572', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1130, 'n_words': 208}