code: 
  
  '''simple docstring'''
  
  import logging
  
  # standard libraries
  import sys
  
  import numpy as np
  import pytest  # type: ignore
  
  # Custom/local libraries
  from matrix import matrix_operation as matop
  
  lowerCAmelCase   :Optional[int]								=    [[1_2, 1_0], [3, 9]]
  lowerCAmelCase   :Optional[int]								=    [[3, 4], [7, 4]]
  lowerCAmelCase   :Optional[Any]								=    [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
  lowerCAmelCase   :List[str]								=    [[3, 0, -2], [2, 0, 2], [0, 1, 1]]
  lowerCAmelCase   :Dict								=    [[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
  lowerCAmelCase   :Optional[int]								=    [1]
  lowerCAmelCase   :int								=    [2]
  
  lowerCAmelCase   :Any								=    logging.getLogger()
  lowerCAmelCase   :Dict								=    logging.DEBUG
  lowerCAmelCase   :Dict								=    logging.StreamHandler(sys.stdout)
  logger.addHandler(stream_handler)
  
  
  
  
  
  @pytest.mark.mat_ops
  @pytest.mark.parametrize(
      ('mat1', 'mat2')	,	[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]	)
  def lowerCamelCase    (    lowerCAmelCase       :			Union[str, Any]	,	lowerCAmelCase       :			str	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	if (np.array(lowercase__	)).shape < (2, 2) or (np.array(lowercase__	)).shape < (2, 2):
  		with pytest.raises(lowercase__	):
  			logger.info(f'\n\t{test_addition.__name__} returned integer'	)
  			matop.add(lowercase__	,	lowercase__	)
  	elif (np.array(lowercase__	)).shape == (np.array(lowercase__	)).shape:
  		logger.info(f'\n\t{test_addition.__name__} with same matrix dims'	)
  		__magic_name__ :					Dict  			=  (np.array(lowercase__	) + np.array(lowercase__	)).tolist()
  		__magic_name__ :					List[str]  			=  matop.add(lowercase__	,	lowercase__	)
  		assert theo == act
  	else:
  		with pytest.raises(lowercase__	):
  			logger.info(f'\n\t{test_addition.__name__} with different matrix dims'	)
  			matop.add(lowercase__	,	lowercase__	)
  
  
  
  
  
  @pytest.mark.mat_ops
  @pytest.mark.parametrize(
      ('mat1', 'mat2')	,	[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]	)
  def lowerCamelCase    (    lowerCAmelCase       :			Dict	,	lowerCAmelCase       :			Optional[int]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	if (np.array(lowercase__	)).shape < (2, 2) or (np.array(lowercase__	)).shape < (2, 2):
  		with pytest.raises(lowercase__	):
  			logger.info(f'\n\t{test_subtraction.__name__} returned integer'	)
  			matop.subtract(lowercase__	,	lowercase__	)
  	elif (np.array(lowercase__	)).shape == (np.array(lowercase__	)).shape:
  		logger.info(f'\n\t{test_subtraction.__name__} with same matrix dims'	)
  		__magic_name__ :					List[Any]  			=  (np.array(lowercase__	) - np.array(lowercase__	)).tolist()
  		__magic_name__ :					str  			=  matop.subtract(lowercase__	,	lowercase__	)
  		assert theo == act
  	else:
  		with pytest.raises(lowercase__	):
  			logger.info(f'\n\t{test_subtraction.__name__} with different matrix dims'	)
  			assert matop.subtract(lowercase__	,	lowercase__	)
  
  
  
  
  
  @pytest.mark.mat_ops
  @pytest.mark.parametrize(
      ('mat1', 'mat2')	,	[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]	)
  def lowerCamelCase    (    lowerCAmelCase       :			Any	,	lowerCAmelCase       :			List[Any]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	if (np.array(lowercase__	)).shape < (2, 2) or (np.array(lowercase__	)).shape < (2, 2):
  		logger.info(f'\n\t{test_multiplication.__name__} returned integer'	)
  		with pytest.raises(lowercase__	):
  			matop.add(lowercase__	,	lowercase__	)
  	elif (np.array(lowercase__	)).shape == (np.array(lowercase__	)).shape:
  		logger.info(f'\n\t{test_multiplication.__name__} meets dim requirements'	)
  		__magic_name__ :					Any  			=  (np.matmul(lowercase__	,	lowercase__	)).tolist()
  		__magic_name__ :					List[Any]  			=  matop.multiply(lowercase__	,	lowercase__	)
  		assert theo == act
  	else:
  		with pytest.raises(lowercase__	):
  			logger.info(
  			    f'\n\t{test_multiplication.__name__} does not meet dim requirements'	)
  			assert matop.subtract(lowercase__	,	lowercase__	)
  
  
  
  
  
  @pytest.mark.mat_ops
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					List[Any]  			=  (3.5 * np.array(lowercase__	)).tolist()
  	__magic_name__ :					Optional[int]  			=  matop.scalar_multiply(lowercase__	,	3.5	)
  	assert theo == act
  
  
  
  
  
  @pytest.mark.mat_ops
  def lowerCamelCase    (    ):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	__magic_name__ :					Tuple  			=  (np.identity(5	)).tolist()
  	__magic_name__ :					str  			=  matop.identity(5	)
  	assert theo == act
  
  
  
  
  
  @pytest.mark.mat_ops
  @pytest.mark.parametrize('mat'	,	[mat_a, mat_b, mat_c, mat_d, mat_e, mat_f]	)
  def lowerCamelCase    (    lowerCAmelCase       :			Optional[int]	):
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  
  
  	if (np.array(lowercase__	)).shape < (2, 2):
  		with pytest.raises(lowercase__	):
  			logger.info(f'\n\t{test_transpose.__name__} returned integer'	)
  			matop.transpose(lowercase__	)
  	else:
  		__magic_name__ :					Optional[int]  			=  (np.transpose(lowercase__	)).tolist()
  		__magic_name__ :					Union[str, Any]  			=  matop.transpose(lowercase__	,	return_map=lowercase__	)
  		assert theo == act
style_context: 
  
  
  '''simple docstring'''
  
  from .number_theory.prime_numbers import next_prime
  class _lowerCamelCase :
  
  
  
  		'''simple docstring'''
  
  
  
  
  
  
  
  		def __init__(      self	:		Dict						,  _A	:		int						,  _A	:		int | None = None						,  _A	:		float | None = None						,  )						->				None:
  			__magic_name__ :					Optional[int]  			=  size_table
  			__magic_name__ :					int  			=  [None] * self.size_table
  			__magic_name__ :					int  			=  0.75 if lim_charge is None else lim_charge
  			__magic_name__ :					int  			=  1 if charge_factor is None else charge_factor
  			__magic_name__ :					list  			=  []
  			__magic_name__ :					dict  			=  {}
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		List[str]    )						->				str:
  			return self._keys
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		Dict    )						->				Optional[Any]:
  			return sum(1 for slot in self.values if slot is not None    ) / (
  			    self.size_table * self.charge_factor
  			)
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		int						,  _A	:		int    )						->				List[Any]:
  			return key % self.size_table
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		List[Any]						,  _A	:		Tuple    )						->				Optional[int]:
  			print(F'step {step_ord}'    )
  			print(list(range(len(self.values    )    )    )    )
  			print(self.values    )
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		str						,  _A	:		Optional[Any]    )						->				Optional[int]:
  			__magic_name__ :					int  			=  1
  			__magic_name__ :					Optional[int]  			=  values
  			for value in values:
  				self.insert_data(_A    )
  				self._step_by_step(_A    )
  				i += 1
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		List[Any]						,  _A	:		List[str]						,  _A	:		List[Any]    )						->				Dict:
  			__magic_name__ :					str  			=  data
  			__magic_name__ :					Optional[int]  			=  data
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		Union[str, Any]						,  _A	:		List[Any]						,  _A	:		Union[str, Any]=None    )						->				int:
  			__magic_name__ :					int  			=  self.hash_function(key + 1    )
  
  			while self.values[new_key] is not None and self.values[new_key] != key:
  				if self.values.count(_A    ) > 0:
  					__magic_name__ :					Dict  			=  self.hash_function(new_key + 1    )
  				else:
  					__magic_name__ :					Tuple  			=  None
  					break
  
  			return new_key
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		List[str]    )						->				Tuple:
  			__magic_name__ :					Dict  			=  [value for value in self.values if value is not None]
  			__magic_name__ :					int  			=  next_prime(self.size_table						,  factor=2    )
  			self._keys.clear()
  			__magic_name__ :					Tuple  			=  [None] * self.size_table  # hell's pointers D: don't DRY ;/
  			for value in survivor_values:
  				self.insert_data(_A    )
  
  
  
  
  
  
  
  		def      __lowerCAmelCase	(      self	:		Tuple						,  _A	:		Union[str, Any]    )						->				Tuple:
  			__magic_name__ :					Tuple  			=  self.hash_function(_A    )
  
  			if self.values[key] is None:
  				self._set_value(_A						,  _A    )
  
  			elif self.values[key] == data:
  				pass
  
  			else:
  				__magic_name__ :					str  			=  self._collision_resolution(_A						,  _A    )
  				if collision_resolution is not None:
  					self._set_value(_A						,  _A    )
  				else:
  					self.rehashing()
  					self.insert_data(_A    )