<commit_before>import { app, BrowserWindow, Menu, shell } from 'electron';
import { getCfg } from './config.js';
import path from 'path';
import os from 'os';
import fs from 'fs';
import { api_literal } from './api.contents.js';

let menu;
let template;
let mainWindow = null;

if (process.env.NODE_ENV === 'production') {
  const sourceMapSupport = require('source-map-support'); // eslint-disable-line
  sourceMapSupport.install();
}

if (process.env.NODE_ENV === 'development') {
  require('electron-debug')(); // eslint-disable-line global-require
  const path = require('path'); // eslint-disable-line
  const p = path.join(__dirname, '..', 'app', 'node_modules'); // eslint-disable-line
  require('module').globalPaths.push(p); // eslint-disable-line
}

var cfg = getCfg();

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit();
});

function appDataDirectory() {
  const path = require('path');
  const os = require('os');

  if (process.platform === 'darwin') {
    return path.join(os.homedir(), 'Library','Application Support','decrediton');
  }

  return path.join(os.homedir(),'.decrediton');
}

function GRPCWalletPort() {
  if (cfg.network == 'mainnet') {
    return cfg.wallet_port;
  }
  return cfg.wallet_port_testnet;
}

function RPCDaemonPort() {
  if (cfg.network == 'mainnet') {
    return cfg.daemon_port;
  }
  return cfg.daemon_port_testnet;<commit_msg>Close when all windows are closed on OSX.<commit_after>import { app, BrowserWindow, Menu, shell } from 'electron';
import { getCfg } from './config.js';
import path from 'path';
import os from 'os';
import fs from 'fs';
import { api_literal } from './api.contents.js';

let menu;
let template;
let mainWindow = null;

if (process.env.NODE_ENV === 'production') {
  const sourceMapSupport = require('source-map-support'); // eslint-disable-line
  sourceMapSupport.install();
}

if (process.env.NODE_ENV === 'development') {
  require('electron-debug')(); // eslint-disable-line global-require
  const path = require('path'); // eslint-disable-line
  const p = path.join(__dirname, '..', 'app', 'node_modules'); // eslint-disable-line
  require('module').globalPaths.push(p); // eslint-disable-line
}

var cfg = getCfg();

app.on('window-all-closed', () => {
  // If we could reopen after closing all windows on OSX we might want
  // to on do this only if !== 'darwin' but since we don't, better to
  // have the same behavior on all platforms.
  app.quit();
});

function appDataDirectory() {
  const path = require('path');
  const os = require('os');

  if (process.platform === 'darwin') {
    return path.join(os.homedir(), 'Library','Application Support','decrediton');
  }

  return path.join(os.homedir(),'.decrediton');
}

function GRPCWalletPort() {
  if (cfg.network == 'mainnet') {
    return cfg.wallet_port;
  }
  return cfg.wallet_port_testnet;
}

function RPCDaemonPort() {
  if (cfg.network == 'mainnet') {
    return cfg.daemon_port;
  }
  return cfg.daemon_port_testnet;
{'fraction_non_alphanumeric': 0.1705607476635514, 'fraction_numerical': 0.0, 'mean_word_length': 4.185121107266436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5795359', 'n_tokens_mistral': 985, 'n_tokens_neox': 973, 'n_words': 242}