<commit_before>-- Metaclass for Components
-- In the future, this will be used to dynamically create Component classes
-- Also has utility functions regarding Component handling
Component = class("Component")

-- TODO this should create a new Component class
function Component:__init()

end

-- Load multiple components and populate the calling functions namespace with them
function Component.load(paths)
  local env = {}
  setmetatable(env, {__index = _G})
  setfenv(2, env)

  for _,path in pairs(paths) do
    local componentName = string.match(path, "[^/]+$")
    env[componentName] = require(path)
  end
end
<commit_msg>Add comment<commit_after>-- Metaclass for Components
-- In the future, this will be used to dynamically create Component classes
-- Also has utility functions regarding Component handling
Component = class("Component")

-- TODO this should create a new Component class
function Component:__init()

end

-- Load multiple components and populate the calling functions namespace with them
-- This should only be called from the top level of a file!
function Component.load(paths)
  local env = {}
  setmetatable(env, {__index = _G})
  setfenv(2, env)

  for _,path in pairs(paths) do
    local componentName = string.match(path, "[^/]+$")
    env[componentName] = require(path)
  end
end

{'fraction_non_alphanumeric': 0.09070121951219512, 'fraction_numerical': 0.001524390243902439, 'mean_word_length': 4.359183673469388, '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': '2924446', 'n_tokens_mistral': 357, 'n_tokens_neox': 350, 'n_words': 149}