code: 
  
  
  
  
  
  import logging
  
  # standard libraries
  import sys
  
  import numpy as np
  import pytest  # type: ignore
  
  # Custom/local libraries
  from matrix import matrix_operation as matop
  
  _lowercase		:     List[Any]     					=[[12, 10], [3, 9]]
  _lowercase		:     Any     					=[[3, 4], [7, 4]]
  _lowercase		:     List[Any]     					=[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
  _lowercase		:     int     					=[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
  _lowercase		:     List[str]     					=[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
  _lowercase		:     List[str]     					=[1]
  _lowercase		:     Dict     					=[2]
  
  _lowercase		:     Optional[Any]     					=logging.getLogger()
  _lowercase		:     str     					=logging.DEBUG
  _lowercase		:     Union[str, Any]     					=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 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__	):
  		if (np.array(__lowerCamelCase	)).shape < (2, 2) or (np.array(__lowerCamelCase	)).shape < (2, 2):
  				with pytest.raises(__lowerCamelCase	):
  						logger.info(F"\n\t{test_addition.__name__} returned integer"	)
  						matop.add(__lowerCamelCase       ,__lowerCamelCase	)
  		elif (np.array(__lowerCamelCase	)).shape == (np.array(__lowerCamelCase	)).shape:
  				logger.info(F"\n\t{test_addition.__name__} with same matrix dims"	)
  				lowerCamelCase_  :    Optional[Any]   	=			(np.array(__lowerCamelCase	) + np.array(__lowerCamelCase	)).tolist()
  				lowerCamelCase_  :    Optional[int]   	=			matop.add(__lowerCamelCase       ,__lowerCamelCase	)
  				assert theo == act
  		else:
  				with pytest.raises(__lowerCamelCase	):
  						logger.info(F"\n\t{test_addition.__name__} with different matrix dims"	)
  						matop.add(__lowerCamelCase       ,__lowerCamelCase	)
  
  
  @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 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__	):
  		if (np.array(__lowerCamelCase	)).shape < (2, 2) or (np.array(__lowerCamelCase	)).shape < (2, 2):
  				with pytest.raises(__lowerCamelCase	):
  						logger.info(F"\n\t{test_subtraction.__name__} returned integer"	)
  						matop.subtract(__lowerCamelCase       ,__lowerCamelCase	)
  		elif (np.array(__lowerCamelCase	)).shape == (np.array(__lowerCamelCase	)).shape:
  				logger.info(F"\n\t{test_subtraction.__name__} with same matrix dims"	)
  				lowerCamelCase_  :    Optional[int]   	=			(np.array(__lowerCamelCase	) - np.array(__lowerCamelCase	)).tolist()
  				lowerCamelCase_  :    List[Any]   	=			matop.subtract(__lowerCamelCase       ,__lowerCamelCase	)
  				assert theo == act
  		else:
  				with pytest.raises(__lowerCamelCase	):
  						logger.info(F"\n\t{test_subtraction.__name__} with different matrix dims"	)
  						assert matop.subtract(__lowerCamelCase       ,__lowerCamelCase	)
  
  
  @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 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__	):
  		if (np.array(__lowerCamelCase	)).shape < (2, 2) or (np.array(__lowerCamelCase	)).shape < (2, 2):
  				logger.info(F"\n\t{test_multiplication.__name__} returned integer"	)
  				with pytest.raises(__lowerCamelCase	):
  						matop.add(__lowerCamelCase       ,__lowerCamelCase	)
  		elif (np.array(__lowerCamelCase	)).shape == (np.array(__lowerCamelCase	)).shape:
  				logger.info(F"\n\t{test_multiplication.__name__} meets dim requirements"	)
  				lowerCamelCase_  :    List[Any]   	=			(np.matmul(__lowerCamelCase       ,__lowerCamelCase	)).tolist()
  				lowerCamelCase_  :    Dict   	=			matop.multiply(__lowerCamelCase       ,__lowerCamelCase	)
  				assert theo == act
  		else:
  				with pytest.raises(__lowerCamelCase	):
  						logger.info(
  						    F"\n\t{test_multiplication.__name__} does not meet dim requirements"	)
  						assert matop.subtract(__lowerCamelCase       ,__lowerCamelCase	)
  
  
  @pytest.mark.mat_ops
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		lowerCamelCase_  :    Optional[Any]   	=			(3.5 * np.array(__lowerCamelCase	)).tolist()
  		lowerCamelCase_  :    Tuple   	=			matop.scalar_multiply(__lowerCamelCase       ,3.5	)
  		assert theo == act
  
  
  @pytest.mark.mat_ops
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		lowerCamelCase_  :    Any   	=			(np.identity(5	)).tolist()
  		lowerCamelCase_  :    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 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__	):
  		if (np.array(__lowerCamelCase	)).shape < (2, 2):
  				with pytest.raises(__lowerCamelCase	):
  						logger.info(F"\n\t{test_transpose.__name__} returned integer"	)
  						matop.transpose(__lowerCamelCase	)
  		else:
  				lowerCamelCase_  :    Union[str, Any]   	=			(np.transpose(__lowerCamelCase	)).tolist()
  				lowerCamelCase_  :    str   	=			matop.transpose(__lowerCamelCase       ,return_map=__lowerCamelCase	)
  				assert theo == act
  
style_context: 
  
  
  
  
  
  def 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__	):
  		return (input_a, input_a).count(0	) % 2
  
  
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		assert xor_gate(0       ,0	) == 0
  		assert xor_gate(0       ,1	) == 1
  		assert xor_gate(1       ,0	) == 1
  		assert xor_gate(1       ,1	) == 0
  
  
  if __name__ == "__main__":
  		print(xor_gate(0, 0))
  		print(xor_gate(0, 1))
  