<commit_before>import {colorize} from './colors.js'
import {getIcon} from './icon.js'
import {Model} from './model.js'
import {revive} from './reviver.js'
import {Duration, Time, sleep} from './time.js'
import {makeExponential, maxBy} from './util.js'

function now() {
  const sinceEpoch = Duration.milliseconds(Date.now()).round('deciseconds')
  const zone = Duration.minutes(-new Date().getTimezoneOffset())
  return new Time(sinceEpoch, zone)
}

function setIcon(data) {
  return browser.browserAction.setIcon({
    imageData: getIcon(16, data, {asImageData: true}),
  })
}

const minCloseAfter = Duration.seconds(0.5)

async function flash(closeAfter = minCloseAfter) {
  const {id} = await browser.windows.create({
    url: 'flash.html',
    type: 'popup',
    state: 'fullscreen',
  })
  await sleep(closeAfter)
  try {
    await browser.windows.remove(id)
  } catch (e) {
    if (e.message != `No window with id: ${id}.`) {<commit_msg>Use Time.now in extension.js.<commit_after>import {colorize} from './colors.js'
import {getIcon} from './icon.js'
import {Model} from './model.js'
import {revive} from './reviver.js'
import {Duration, Time, sleep} from './time.js'
import {makeExponential, maxBy} from './util.js'

function now() {
  const time = Time.now()
  const sinceEpoch = time.sinceEpoch.round('deciseconds')
  return new Time(sinceEpoch, time.zone)
}

function setIcon(data) {
  return browser.browserAction.setIcon({
    imageData: getIcon(16, data, {asImageData: true}),
  })
}

const minCloseAfter = Duration.seconds(0.5)

async function flash(closeAfter = minCloseAfter) {
  const {id} = await browser.windows.create({
    url: 'flash.html',
    type: 'popup',
    state: 'fullscreen',
  })
  await sleep(closeAfter)
  try {
    await browser.windows.remove(id)
  } catch (e) {
    if (e.message != `No window with id: ${id}.`) {
{'fraction_non_alphanumeric': 0.15945945945945947, 'fraction_numerical': 0.004324324324324324, 'mean_word_length': 4.113259668508287, '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': '3892080', 'n_tokens_mistral': 622, 'n_tokens_neox': 618, 'n_words': 162}