<commit_before><?php

/**
 * Represents an instance of a Device's Asset resource from the API.
 * Holds data for a Device's Asset and provides methods to retrive
 * objects related to the asset such as its Group.
 *
 * @category   ColoCrossing
 * @package    ColoCrossing_Object
 * @subpackage ColoCrossing_Object_Device
 */
class ColoCrossing_Object_Device_Asset extends ColoCrossing_Resource_Object
{

	/**
	 * Retrieves list of Group objects that this asset belong to. The group objects
	 * have their Id and Name.
	 * @return array<ColoCrossing_Object>	The Asset's Groups
	 */
	public function getGroups()
	{
		return $this->getObjectArray('groups');
	}

	/**
	 * Retrieves the Group object that this asset belongs to. The group object
	 * has it's Id and Name.
	 * @param  int 		$id 		The Id
	 * @return ColoCrossing_Object	The Asset's Group
	 */
	public function getGroup($id)
	{
		$groups = $this->getGroups();

		return ColoCrossing_Utility::getObjectFromCollectionById($groups, $id);
	}

}<commit_msg>Add Function to Get List of Group Names from an Asset<commit_after><?php

/**
 * Represents an instance of a Device's Asset resource from the API.
 * Holds data for a Device's Asset and provides methods to retrive
 * objects related to the asset such as its Group.
 *
 * @category   ColoCrossing
 * @package    ColoCrossing_Object
 * @subpackage ColoCrossing_Object_Device
 */
class ColoCrossing_Object_Device_Asset extends ColoCrossing_Resource_Object
{

	/**
	 * Retrieves list of Group objects that this asset belong to. The group objects
	 * have their Id and Name.
	 * @return array<ColoCrossing_Object>	The Asset's Groups
	 */
	public function getGroups()
	{
		return $this->getObjectArray('groups');
	}

	/**
	 * Retrieves the Group object that this asset belongs to. The group object
	 * has it's Id and Name.
	 * @param  int 		$id 		The Id
	 * @return ColoCrossing_Object	The Asset's Group
	 */
	public function getGroup($id)
	{
		$groups = $this->getGroups();

		return ColoCrossing_Utility::getObjectFromCollectionById($groups, $id);
	}

	/**
	 * Retrieves list of Names of the Groups that this asset belong to.
	 * @return array<string>	The Asset's Group's Names
	 */
	public function getGroupsNames()
	{
		$groups = $this->getGroups();

		return array_map(function($group) {
			return $group->getName();
		}, $groups);
	}

}
{'fraction_non_alphanumeric': 0.09331060928845335, 'fraction_numerical': 0.0, 'mean_word_length': 3.9535864978902953, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '4216086', 'n_tokens_mistral': 768, 'n_tokens_neox': 701, 'n_words': 248}