<commit_before>import * as uuid4 from 'uuid/v4';
const Insight = require('insight');
const pkg = require('../package.json');

const executionId = uuid4();

export const insight = new Insight({
  // Google Analytics tracking code
  trackingCode: 'UA-41425441-15',
  pkg,
});

export enum Category {
  EXECUTION = 'execution',
}

export enum Action {
  START = 'start',
  STOP = 'stop',
  ERROR_STOP = 'error_stop',
  GSUTIL_NOT_INSTALLED = 'gsutil_not_installed',
}

export const trackEvent = (category: Category, action: Action) => {
  console.log({
    category,
    action,
    label: executionId,
  });
  insight.trackEvent({
    category,
    action,
    label: executionId,
  });
};

export const checkForOptOut = async () => {
  if (insight.optOut === undefined) {
    await new Promise((resolve, reject) => {
      insight.askPermission(null, (err: any, success: any) => {
        if (err) {
          reject(err);
        } else {
          resolve(success);
        }
      });<commit_msg>didn't mean to include logging.<commit_after>import * as uuid4 from 'uuid/v4';
const Insight = require('insight');
const pkg = require('../package.json');

const executionId = uuid4();

export const insight = new Insight({
  // Google Analytics tracking code
  trackingCode: 'UA-41425441-15',
  pkg,
});

export enum Category {
  EXECUTION = 'execution',
}

export enum Action {
  START = 'start',
  STOP = 'stop',
  ERROR_STOP = 'error_stop',
  GSUTIL_NOT_INSTALLED = 'gsutil_not_installed',
}

export const trackEvent = (category: Category, action: Action) => {
  insight.trackEvent({
    category,
    action,
    label: executionId,
  });
};

export const checkForOptOut = async () => {
  if (insight.optOut === undefined) {
    await new Promise((resolve, reject) => {
      insight.askPermission(null, (err: any, success: any) => {
        if (err) {
          reject(err);
        } else {
          resolve(success);
        }
      });
{'fraction_non_alphanumeric': 0.14418125643666324, 'fraction_numerical': 0.013388259526261586, 'mean_word_length': 3.1078224101479917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4286276', 'n_tokens_mistral': 642, 'n_tokens_neox': 615, 'n_words': 159}