<commit_before>const child_process = require('child_process')
const fs = require('fs')
const http = require('http')
const path = require('path')

const electron = require('electron')
const {app, BrowserWindow} = electron

const {addMenu} = require('./menu.js')
const {getLogger} = require('./logging.js')
const {initAutoUpdater} = require('./updater.js')
const {ServerManager} = require('./servermanager.js')


let serverManager = new ServerManager()
let mainWindow

if (process.env.NODE_ENV == 'development'){
  require('electron-debug')({showDevTools: 'undocked'});
}

function createWindow () {
  mainWindow = new BrowserWindow({width: 1038, height: 740})
  mainWindow.loadURL("http://127.0.0.1:31950")
  mainWindow.on('closed', function () {
    mainWindow = null
    app.quit()
  })
}

function createAndSetAppDataDir() {
  if (!app.isReady()) {
    throw Error("Attempting to create otone_data dir when app is not ready")
  }
  const appDataDir = path.join(app.getPath('userData'), 'otone_data')

  if (!fs.existsSync(appDataDir)) {
    fs.mkdirSync(appDataDir)
  }
  process.env['APP_DATA_DIR'] = appDataDir
}

function startUp() {
  // Prepare app data dir (necessary for logging errors that occur during setup)<commit_msg>change window size<commit_after>const child_process = require('child_process')
const fs = require('fs')
const http = require('http')
const path = require('path')

const electron = require('electron')
const {app, BrowserWindow} = electron

const {addMenu} = require('./menu.js')
const {getLogger} = require('./logging.js')
const {initAutoUpdater} = require('./updater.js')
const {ServerManager} = require('./servermanager.js')


let serverManager = new ServerManager()
let mainWindow

if (process.env.NODE_ENV == 'development'){
  require('electron-debug')({showDevTools: 'undocked'});
}

function createWindow () {
  mainWindow = new BrowserWindow({width: 1038, height: 650})
  mainWindow.loadURL("http://127.0.0.1:31950")
  mainWindow.on('closed', function () {
    mainWindow = null
    app.quit()
  })
}

function createAndSetAppDataDir() {
  if (!app.isReady()) {
    throw Error("Attempting to create otone_data dir when app is not ready")
  }
  const appDataDir = path.join(app.getPath('userData'), 'otone_data')

  if (!fs.existsSync(appDataDir)) {
    fs.mkdirSync(appDataDir)
  }
  process.env['APP_DATA_DIR'] = appDataDir
}

function startUp() {
  // Prepare app data dir (necessary for logging errors that occur during setup)
{'fraction_non_alphanumeric': 0.15241183623834617, 'fraction_numerical': 0.014592622618565058, 'mean_word_length': 5.004866180048662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7271997', 'n_tokens_mistral': 813, 'n_tokens_neox': 778, 'n_words': 189}