<commit_before>
-- Add filesystem-compatible package loader
table.insert(package.loaders, 1, function(modname)
  modname = modname:gsub("%.", "/")
  for x in package.path:gmatch("[^;]+") do
    local filename = x:gsub("?", modname)
    if love.filesystem.exists(filename) then
      return assert(loadstring(love.filesystem.read(filename), "=" .. filename))
    end
  end
end)


function love.run()
  -- Prepare arguments
  local args = {}
  for i = 2, #love.argv do
    args[i - 1] = love.argv[i]
  end
  -- Do load callback
  if love.load then love.load(args) end
  love.timer.step()
  while true do
    -- Handle mouse events
    for _, e in ipairs(love.mouse.poll()) do
      if e.type == "motion" then
        if love.mousemoved then love.mousemoved(e.x, e.y, e.dx, e.dy) end
      elseif e.type == "pressed" then
        if love.mousepressed then love.mousepressed(e.x, e.y, e.button) end
      elseif e.type == "released" then
        if love.mousereleased then love.mousereleased(e.x, e.y, e.button) end
      end
    end
    -- Handle keyboard events
    for _, e in ipairs(love.keyboard.poll()) do
      if e.type == "down" then
        if love.keypressed then love.keypressed(e.key, e.code, e.isrepeat) end
      elseif e.type == "up" then
        if love.keyreleased then love.keyreleased(e.key, e.code) end
      elseif e.type == "text" then
        if love.textinput then love.textinput(e.text) end
      end
    end
    -- Update
    love.timer.step()
    local dt = love.timer.getDelta()
    if love.update then love.update(dt) end
    -- Draw
    love.graphics.clear()
    if love.draw then love.draw() end
    love.graphics.present()
  end
end


function love.errhand(msg)
  -- Init error text
  local err = { "Error\n", msg }
  local trace = debug.traceback("", 2)
  for line in string.gmatch(trace, "([^\t]-)\n") do
    table.insert(err, line)
  end
  local str = table.concat(err, "\n")
  -- Init error state
  love.graphics.reset()
  pcall(love.graphics.setBackgroundColor, 89, 157, 220)
  -- Do error main loop
  while true do
    for _, e in ipairs(love.keyboard.poll()) do
      if e.type == "down" and e.code == 1 then
        os.exit()
      end
    end
    love.graphics.clear()
    love.graphics.print(str, 6, 6)
    love.graphics.present()
  end
end


xpcall(function() require("main") end, love.errhand)
xpcall(love.run, love.errhand)<commit_msg>Added setting of custom `package.path` to boot.lua<commit_after>

function love.boot()
  -- Init package.path and add filesystem-compatible package loader
  package.path = "?.lua;?/init.lua"
  table.insert(package.loaders, 1, function(modname)
    modname = modname:gsub("%.", "/")
    for x in package.path:gmatch("[^;]+") do
      local file = x:gsub("?", modname)
      if love.filesystem.exists(file) then
        return assert(loadstring(love.filesystem.read(file), "=" .. file))
      end
    end
  end)
end


function love.run()
  -- Prepare arguments
  local args = {}
  for i = 2, #love.argv do
    args[i - 1] = love.argv[i]
  end

  -- Do load callback
  if love.load then love.load(args) end
  love.timer.step()

  while true do
    -- Handle mouse events
    for _, e in ipairs(love.mouse.poll()) do
      if e.type == "motion" then
        if love.mousemoved then love.mousemoved(e.x, e.y, e.dx, e.dy) end
      elseif e.type == "pressed" then
        if love.mousepressed then love.mousepressed(e.x, e.y, e.button) end
      elseif e.type == "released" then
        if love.mousereleased then love.mousereleased(e.x, e.y, e.button) end
      end
    end
    -- Handle keyboard events
    for _, e in ipairs(love.keyboard.poll()) do
      if e.type == "down" then
        if love.keypressed then love.keypressed(e.key, e.code, e.isrepeat) end
      elseif e.type == "up" then
        if love.keyreleased then love.keyreleased(e.key, e.code) end
      elseif e.type == "text" then
        if love.textinput then love.textinput(e.text) end
      end
    end
    -- Update
    love.timer.step()
    local dt = love.timer.getDelta()
    if love.update then love.update(dt) end
    -- Draw
    love.graphics.clear()
    if love.draw then love.draw() end
    love.graphics.present()
  end
end


function love.errhand(msg)
  -- Init error text
  local err = { "Error\n", msg }
  local trace = debug.traceback("", 2)
  for line in string.gmatch(trace, "([^\t]-)\n") do
    table.insert(err, line)
  end
  local str = table.concat(err, "\n")

  -- Init error state
  love.graphics.reset()
  pcall(love.graphics.setBackgroundColor, 89, 157, 220)

  -- Do error main loop
  while true do
    for _, e in ipairs(love.keyboard.poll()) do
      if e.type == "down" and e.code == 1 then
        os.exit()
      end
    end
    love.graphics.clear()
    love.graphics.print(str, 6, 6)
    love.graphics.present()
  end
end


xpcall(love.boot, love.errhand)
xpcall(function() require("main") end, love.errhand)
xpcall(love.run, love.errhand)
{'fraction_non_alphanumeric': 0.1373346897253306, 'fraction_numerical': 0.006103763987792472, 'mean_word_length': 2.606749816581071, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '764030', 'n_tokens_mistral': 1721, 'n_tokens_neox': 1665, 'n_words': 471}