<commit_before>if (require('electron-squirrel-startup')) return
const child_process = require('child_process')
const fs = require('fs')
const http = require('http')
const path = require('path')
const urlJoin = require('url-join')

const electron = require('electron')
const rp = require('request-promise')
const {app, BrowserWindow, ipcMain} = electron

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

let appWindowUrl = 'http://localhost:31950/'
let mainWindow
let mainLogger
let serverManager = new ServerManager()

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

function createWindow (windowUrl) {
  mainLogger.info('Creating Electron App window at ' + windowUrl)
  mainWindow = new BrowserWindow({
    width: 1060,
    height: 750
  })
  mainWindow.loadURL(windowUrl)
  mainWindow.on('closed', function () {
    mainLogger.info('Electron App window closed, quitting App')
    rp(windowUrl + 'exit')
      .then((html) => {
        mainWindow = null
        app.quit()
      })
      .catch((err) => {
        mainLogger.info(err)
        mainWindow = null
        app.quit()
      })
  })
  // Note: Auth0 pop window does not close itself, this will this window when it pops up
  setInterval(() => {
    BrowserWindow.getAllWindows()<commit_msg>prevents app window from caching<commit_after>if (require('electron-squirrel-startup')) return
const child_process = require('child_process')
const fs = require('fs')
const http = require('http')
const path = require('path')
const urlJoin = require('url-join')

const electron = require('electron')
const rp = require('request-promise')
const {app, BrowserWindow, ipcMain} = electron

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

let appWindowUrl = 'http://localhost:31950/'
let mainWindow
let mainLogger
let serverManager = new ServerManager()

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

function createWindow (windowUrl) {
  mainLogger.info('Creating Electron App window at ' + windowUrl)
  mainWindow = new BrowserWindow({
    width: 1060,
    height: 750
  })
  mainWindow.loadURL(windowUrl, {"extraHeaders" : "pragma: no-cache\n"})
  mainWindow.on('closed', function () {
    mainLogger.info('Electron App window closed, quitting App')
    rp(windowUrl + 'exit')
      .then((html) => {
        mainWindow = null
        app.quit()
      })
      .catch((err) => {
        mainLogger.info(err)
        mainWindow = null
        app.quit()
      })
  })
  // Note: Auth0 pop window does not close itself, this will this window when it pops up
  setInterval(() => {
    BrowserWindow.getAllWindows()
{'fraction_non_alphanumeric': 0.15018427518427518, 'fraction_numerical': 0.010442260442260442, 'mean_word_length': 4.178060413354531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2102093', 'n_tokens_mistral': 1022, 'n_tokens_neox': 973, 'n_words': 244}