<commit_before>--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                  C O M M A N D P O S T    U I    A P I                     --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

--- === cp.ui.axutils ===
---
--- Utility functions to support `hs._asm.axuielement`

--------------------------------------------------------------------------------
--
-- EXTENSIONS:
--
--------------------------------------------------------------------------------
local log						= require("hs.logger").new("axutils")

local fnutils					= require("hs.fnutils")

local canvas					= require("hs.canvas")

--------------------------------------------------------------------------------
--
-- THE MODULE:
--
--------------------------------------------------------------------------------

local axutils = {}

-- TODO: Add documentation
function axutils.hasAttributeValue(element, name, value)
	return element and element:attributeValue(name) == value
end

--- cp.ui.axutils.childWith(element, name, value) -> axuielement
--- Function
--- This searches for the first child of the specified element which has an attribute with the matching name and value.
---
--- Parameters:
---  * element	- the axuielement
---  * name		- the name of the attribute
---  * value	- the value of the attribute
---
--- Returns:
---  * The first matching child, or nil if none was found<commit_msg>#970 Fixed stickler issue.<commit_after>--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                  C O M M A N D P O S T    U I    A P I                     --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

--- === cp.ui.axutils ===
---
--- Utility functions to support `hs._asm.axuielement`

--------------------------------------------------------------------------------
--
-- EXTENSIONS:
--
--------------------------------------------------------------------------------
-- local log						= require("hs.logger").new("axutils")

local fnutils					= require("hs.fnutils")

local canvas					= require("hs.canvas")

--------------------------------------------------------------------------------
--
-- THE MODULE:
--
--------------------------------------------------------------------------------

local axutils = {}

-- TODO: Add documentation
function axutils.hasAttributeValue(element, name, value)
	return element and element:attributeValue(name) == value
end

--- cp.ui.axutils.childWith(element, name, value) -> axuielement
--- Function
--- This searches for the first child of the specified element which has an attribute with the matching name and value.
---
--- Parameters:
---  * element	- the axuielement
---  * name		- the name of the attribute
---  * value	- the value of the attribute
---
--- Returns:
---  * The first matching child, or nil if none was found
{'fraction_non_alphanumeric': 0.48288736776602365, 'fraction_numerical': 0.0009334163036714375, 'mean_word_length': 0.7137526652452025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5980084', 'n_tokens_mistral': 642, 'n_tokens_neox': 610, 'n_words': 206}