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
  
  __lowerCAmelCase     =			[[12, 10], [3, 9]]
  __lowerCAmelCase     =			[[3, 4], [7, 4]]
  __lowerCAmelCase     =			[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
  __lowerCAmelCase     =			[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
  __lowerCAmelCase     =			[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
  __lowerCAmelCase     =			[1]
  __lowerCAmelCase     =			[2]
  
  __lowerCAmelCase     =			logging.getLogger()
  __lowerCAmelCase     =			logging.DEBUG
  __lowerCAmelCase     =			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     a						(      _lowercase ,						_lowercase       )     ->Optional[int]:
  
  
  
  
  
  
  
  		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"""       )
  				UpperCamelCase__         =	(np.array(_lowercase       ) + np.array(_lowercase       )).tolist()
  				UpperCamelCase__         =	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     a						(      _lowercase ,						_lowercase       )     ->Optional[Any]:
  
  
  
  
  
  
  
  		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"""       )
  				UpperCamelCase__         =	(np.array(_lowercase       ) - np.array(_lowercase       )).tolist()
  				UpperCamelCase__         =	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     a						(      _lowercase ,						_lowercase       )     ->str:
  
  
  
  
  
  
  
  		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"""       )
  				UpperCamelCase__         =	(np.matmul(_lowercase ,						_lowercase       )).tolist()
  				UpperCamelCase__         =	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     a						(      )     ->Any:
  		UpperCamelCase__         =	(3.5 * np.array(_lowercase       )).tolist()
  		UpperCamelCase__         =	matop.scalar_multiply(_lowercase ,						3.5       )
  		assert theo == act
  
  @pytest.mark.mat_ops
  def     a						(      )     ->Optional[int]:
  		UpperCamelCase__         =	(np.identity(5       )).tolist()
  		UpperCamelCase__         =	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     a						(      _lowercase       )     ->Dict:
  
  
  
  
  
  
  
  		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:
  				UpperCamelCase__         =	(np.transpose(_lowercase       )).tolist()
  				UpperCamelCase__         =	matop.transpose(_lowercase ,						return_map=_lowercase       )
  				assert theo == act
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  import warnings
  
  from .generation import FlaxGenerationMixin
  
  
  
  
  class   _UpperCAmelCase	(   _lowercase					):
  					# warning at import time
  					warnings.warn(
  					    "Importing `FlaxGenerationMixin` from `src/transformers/generation_flax_utils.py` is deprecated and will "
  					    "be removed in Transformers v5. Import as `from transformers import FlaxGenerationMixin` instead." ,       _lowercase ,       )
  
  
  
  
  
  