<commit_before>--- Utility functions for use with collection service tags
-- @module CollectionServiceUtils

local CollectionService = game:GetService("CollectionService")

local CollectionServiceUtils = {}

function CollectionServiceUtils.findFirstAncestor(tagName, child)
	assert(type(tagName) == "string")
	assert(typeof(child) == "Instance")

	local current = child.Parent
	while current do
		if CollectionService:HasTag(current, tagName) then
			return current
		end
		current = current.Parent
	end
	return nil
end


return CollectionServiceUtils<commit_msg>Add removeAllTags<commit_after>--- Utility functions for use with collection service tags
-- @module CollectionServiceUtils

local CollectionService = game:GetService("CollectionService")

local CollectionServiceUtils = {}

function CollectionServiceUtils.findFirstAncestor(tagName, child)
	assert(type(tagName) == "string")
	assert(typeof(child) == "Instance")

	local current = child.Parent
	while current do
		if CollectionService:HasTag(current, tagName) then
			return current
		end
		current = current.Parent
	end
	return nil
end

function CollectionServiceUtils.removeAllTags(instance)
	for _, tag in pairs(CollectionService:GetTags(instance)) do
		CollectionService:RemoveTag(instance, tag)
	end
end

return CollectionServiceUtils
{'fraction_non_alphanumeric': 0.08070714834742505, 'fraction_numerical': 0.0, 'mean_word_length': 6.273743016759776, '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': '4890350', 'n_tokens_mistral': 361, 'n_tokens_neox': 344, 'n_words': 99}