<commit_before>CSON = require 'season'
fs = require 'fs'
rimraf = require 'rimraf'
Cache = require './cache'

exports = exports ? this
exports.Database =
  cache: {}

  path: ->
    CSON.readFileSync(__dirname + '/../data-path.cson')['path']

  clearForImport: ->
    rimraf.sync(@path() + "pupils/", (e) ->
      alert("Deletion Error: " + e)
    )
    fs.unlinkSync(@path() + "class-list.cson")

  loadCache: ->
    @cache = Cache
    @cache.cacheFolder(@path())

exports.ClassList = require './models/class-list'
exports.Config = require './models/config'
exports.Menu = require './models/menu'
exports.PupilList = require './models/pupil-list'
exports.Register = require './models/register'
exports.Session = require './models/session'<commit_msg>ensure that class-list.cson exists before we try to delete it<commit_after>CSON = require 'season'
fs = require 'fs'
rimraf = require 'rimraf'
Cache = require './cache'

exports = exports ? this
exports.Database =
  cache: {}

  path: ->
    CSON.readFileSync(__dirname + '/../data-path.cson')['path']

  clearForImport: ->
    rimraf.sync(@path() + "pupils/", (e) ->
      alert("Deletion Error: " + e)
    )
    if(fs.existsSync(@path() + "class-list.cson"))
      fs.unlinkSync(@path() + "class-list.cson")

  loadCache: ->
    @cache = Cache
    @cache.cacheFolder(@path())

exports.ClassList = require './models/class-list'
exports.Config = require './models/config'
exports.Menu = require './models/menu'
exports.PupilList = require './models/pupil-list'
exports.Register = require './models/register'
exports.Session = require './models/session'
{'fraction_non_alphanumeric': 0.17654398003742983, 'fraction_numerical': 0.0, 'mean_word_length': 3.5568181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1261486', 'n_tokens_mistral': 529, 'n_tokens_neox': 520, 'n_words': 112}