<commit_before>
--- A module which installs a Lua package loader that is LuaRocks-aware.
-- This loader uses dependency information from the LuaRocks tree to load
-- correct versions of modules. It does this by constructing a "context"
-- table in the environment, which records which versions of packages were
-- used to load previous modules, so that the loader chooses versions
-- that are declared to be compatible with the ones loaded earlier.
local loaders = package.loaders or package.searchers
local require, ipairs, table, type, next, tostring, error =
      require, ipairs, table, type, next, tostring, error
local unpack = unpack or table.unpack

local loader = {}

local is_clean = not package.loaded["luarocks.core.cfg"]

-- This loader module depends only on core modules.
local cfg = require("luarocks.core.cfg")
local cfg_ok, err = cfg.init()
if cfg_ok then
   cfg.init_package_paths()
end

local path = require("luarocks.core.path")
local manif = require("luarocks.core.manif")
local vers = require("luarocks.core.vers")
local require = nil
--------------------------------------------------------------------------------

-- Workaround for wrappers produced by older versions of LuaRocks
local temporary_global = false
if luarocks then
   -- The site_config.lua file generated by old versions uses module(),
   -- so it produces a global `luarocks` table. Since we have the table,
   -- add the `loader` field to make the old wrappers happy.<commit_msg>Avoid uninitialized variable check, for Terra compatibility (#1182)<commit_after>
--- A module which installs a Lua package loader that is LuaRocks-aware.
-- This loader uses dependency information from the LuaRocks tree to load
-- correct versions of modules. It does this by constructing a "context"
-- table in the environment, which records which versions of packages were
-- used to load previous modules, so that the loader chooses versions
-- that are declared to be compatible with the ones loaded earlier.
local loaders = package.loaders or package.searchers
local require, ipairs, table, type, next, tostring, error =
      require, ipairs, table, type, next, tostring, error
local unpack = unpack or table.unpack

local loader = {}

local is_clean = not package.loaded["luarocks.core.cfg"]

-- This loader module depends only on core modules.
local cfg = require("luarocks.core.cfg")
local cfg_ok, err = cfg.init()
if cfg_ok then
   cfg.init_package_paths()
end

local path = require("luarocks.core.path")
local manif = require("luarocks.core.manif")
local vers = require("luarocks.core.vers")
local require = nil
--------------------------------------------------------------------------------

-- Workaround for wrappers produced by older versions of LuaRocks
local temporary_global = false
local status, luarocks_value = pcall(function() return luarocks end)
if status and luarocks_value then
   -- The site_config.lua file generated by old versions uses module(),
   -- so it produces a global `luarocks` table. Since we have the table,
   -- add the `loader` field to make the old wrappers happy.
{'fraction_non_alphanumeric': 0.12840466926070038, 'fraction_numerical': 0.0012970168612191958, 'mean_word_length': 3.296657381615599, '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': '3359771', 'n_tokens_mistral': 810, 'n_tokens_neox': 798, 'n_words': 367}