<commit_before>// eslint-disable-next-line import/no-extraneous-dependencies
import { app } from 'electron'
import Config from 'electron-config'
import fs from 'fs'
import log from 'electron-log'
import path from 'path'





import {
  copyFile,
  generateTempFilepath,
  uploadFile,
} from '.'





const config = new Config





const handleScreenshot = async filename => {
  log.info('Handling screenshot')

  const filepath = path.resolve(app.getPath('desktop'), filename)
  const tempFilepath = generateTempFilepath(path.extname(filename), filename)

  try {
    fs.readFileSync(filepath)
  } catch (error) {
    log.error('Failed to read file. Aborting.')
    return
  }

  await uploadFile(await copyFile(filepath, tempFilepath))

  if (config.get('deleteAfterUpload')) {
    fs.unlinkSync(filepath)<commit_msg>Deobfuscate some confusing code<commit_after>// eslint-disable-next-line import/no-extraneous-dependencies
import { app } from 'electron'
import Config from 'electron-config'
import fs from 'fs'
import log from 'electron-log'
import path from 'path'





import {
  copyFile,
  generateTempFilepath,
  uploadFile,
} from '.'





const config = new Config





const handleScreenshot = async filename => {
  log.info('Handling screenshot')

  const filepath = path.resolve(app.getPath('desktop'), filename)
  const tempFilepath = generateTempFilepath(path.extname(filename), filename)

  try {
    fs.readFileSync(filepath)
  } catch (error) {
    log.error('Failed to read file. Aborting.')
    return
  }

  await copyFile(filepath, tempFilepath)
  await uploadFile(tempFilepath)

  if (config.get('deleteAfterUpload')) {
    fs.unlinkSync(filepath)
{'fraction_non_alphanumeric': 0.11024565608148593, 'fraction_numerical': 0.0, 'mean_word_length': 4.235109717868339, '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': '3001653', 'n_tokens_mistral': 554, 'n_tokens_neox': 510, 'n_words': 129}