<commit_before><?php
namespace Objection\Structure;


class HashSet
{
	private $set = [];
	
	
	/**
	 * @param string|int|array $key Single element or array of elements. 
	 */
	public function add($key)
	{
		if (!is_array($key))
		{
			$keys = [$key => null];
		}
		else
		{
			$keys = array_combine($key, array_fill(0, count($key), null));
		}
		
		$this->set = array_merge($this->set, $keys);
	}
	
	/**
	 * @param string|int|array $key
	 */
	public function delete($key)
	{
		if (!is_array($key))
		{
			unset($this->set[$key]);
		}
		else
		{
			foreach ($key as $singleKey)
			{
				unset($this->set[$singleKey]);
			}
		}
	}
	
	/**
	 * @param string|int $key
	 * @return bool
	 */
	public function has($key)
	{
		return array_key_exists($key, $this->set);
	}
	
	/**
	 * @param array $keys
	 * @return bool
	 */
	public function hasAll(array $keys)
	{
		foreach ($keys as $key)
		{
			if (!array_key_exists($key, $this->set))
			{
				return false;
			}
		}
		
		return true;
	}
	
	/**
	 * @param array $keys
	 * @return bool
	 */
	public function hasAny(array $keys)
	{
		foreach ($keys as $key)
		{
			if (array_key_exists($key, $this->set))
			{
				return true;
			}
		}
		
		return false;
	}
}<commit_msg>Add count ans isEmpty<commit_after><?php
namespace Objection\Structure;


class HashSet
{
	private $set = [];
	
	
	/**
	 * @param string|int|array $key Single element or array of elements. 
	 */
	public function add($key)
	{
		if (!is_array($key))
		{
			$keys = [$key => null];
		}
		else
		{
			$keys = array_combine($key, array_fill(0, count($key), null));
		}
		
		$this->set = array_merge($this->set, $keys);
	}
	
	/**
	 * @param string|int|array $key
	 */
	public function remove($key)
	{
		if (!is_array($key))
		{
			unset($this->set[$key]);
		}
		else
		{
			foreach ($key as $singleKey)
			{
				unset($this->set[$singleKey]);
			}
		}
	}
	
	/**
	 * @param string|int $key
	 * @return bool
	 */
	public function has($key)
	{
		return array_key_exists($key, $this->set);
	}
	
	/**
	 * @param array $keys
	 * @return bool
	 */
	public function hasAll(array $keys)
	{
		foreach ($keys as $key)
		{
			if (!array_key_exists($key, $this->set))
			{
				return false;
			}
		}
		
		return true;
	}
	
	/**
	 * @param array $keys
	 * @return bool
	 */
	public function hasAny(array $keys)
	{
		foreach ($keys as $key)
		{
			if (array_key_exists($key, $this->set))
			{
				return true;
			}
		}
		
		return false;
	}
	
	/**
	 * @return int
	 */
	public function count()
	{
		return count($this->set);
	}
	
	/**
	 * @return bool
	 */
	public function isEmpty()
	{
		return (bool)$this->set;
	}
}
{'fraction_non_alphanumeric': 0.178544061302682, 'fraction_numerical': 0.0007662835249042146, 'mean_word_length': 2.5964187327823693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '3934761', 'n_tokens_mistral': 1169, 'n_tokens_neox': 977, 'n_words': 215}