<commit_before>-- Copyright 2022 <NAME> <<EMAIL>>
-- Licensed to the public under the Apache License 2.0.

local coroutine, assert, error, type, require = coroutine, assert, error, type, require
local tmpl = require "luci.template"
local util = require "luci.util"
local http = require "luci.http"


--- LuCI ucode bridge library.
module "luci.ucodebridge"

local function run(fn, ...)
	local co = coroutine.create(fn)
	local ok, ret

	while coroutine.status(co) ~= "dead" do
		ok, ret = coroutine.resume(co, ...)

		if not ok then
			error(ret)
		end
	end

	return ret
end

function compile(path)
	run(function(path)
		return tmpl.Template(path)
	end, path)<commit_msg>luci-lua-runtime: preload luci.sys<commit_after>-- Copyright 2022 <NAME> <<EMAIL>>
-- Licensed to the public under the Apache License 2.0.

local coroutine, assert, error, type, require = coroutine, assert, error, type, require
local tmpl = require "luci.template"
local util = require "luci.util"
local http = require "luci.http"
local sys  = require "luci.sys"


--- LuCI ucode bridge library.
module "luci.ucodebridge"

local function run(fn, ...)
	local co = coroutine.create(fn)
	local ok, ret

	while coroutine.status(co) ~= "dead" do
		ok, ret = coroutine.resume(co, ...)

		if not ok then
			error(ret)
		end
	end

	return ret
end

function compile(path)
	run(function(path)
		return tmpl.Template(path)
	end, path)
{'fraction_non_alphanumeric': 0.12347451543431442, 'fraction_numerical': 0.008614501076812634, 'mean_word_length': 3.8912280701754387, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6263654', 'n_tokens_mistral': 501, 'n_tokens_neox': 481, 'n_words': 157}