




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						:							List[Any]			     =						[[12, 10], [3, 9]]
__lowerCAmelCase						:							Any			     =						[[3, 4], [7, 4]]
__lowerCAmelCase						:							Any			     =						[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
__lowerCAmelCase						:							Any			     =						[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
__lowerCAmelCase						:							Dict			     =						[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
__lowerCAmelCase						:							List[Any]			     =						[1]
__lowerCAmelCase						:							Optional[int]			     =						[2]

__lowerCAmelCase						:							int			     =						logging.getLogger()
__lowerCAmelCase						:							Optional[int]			     =						logging.DEBUG
__lowerCAmelCase						:							Optional[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      __magic_name__							(					A						:   Tuple,    A						:   List[str]  ):






			'''simple docstring'''







			if (np.array(A__  )).shape < (2, 2) or (np.array(A__  )).shape < (2, 2):
						with pytest.raises(A__  ):
									logger.info(F"""\n\t{test_addition.__name__} returned integer"""  )
									matop.add(A__,    A__  )
			elif (np.array(A__  )).shape == (np.array(A__  )).shape:
						logger.info(F"""\n\t{test_addition.__name__} with same matrix dims"""  )
						a       =     (np.array(A__  ) + np.array(A__  )).tolist()
						a       =     matop.add(A__,    A__  )
						assert theo == act
			else:
						with pytest.raises(A__  ):
									logger.info(F"""\n\t{test_addition.__name__} with different matrix dims"""  )
									matop.add(A__,    A__  )




@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      __magic_name__							(					A						:   List[str],    A						:   Dict  ):






			'''simple docstring'''







			if (np.array(A__  )).shape < (2, 2) or (np.array(A__  )).shape < (2, 2):
						with pytest.raises(A__  ):
									logger.info(F"""\n\t{test_subtraction.__name__} returned integer"""  )
									matop.subtract(A__,    A__  )
			elif (np.array(A__  )).shape == (np.array(A__  )).shape:
						logger.info(F"""\n\t{test_subtraction.__name__} with same matrix dims"""  )
						a       =     (np.array(A__  ) - np.array(A__  )).tolist()
						a       =     matop.subtract(A__,    A__  )
						assert theo == act
			else:
						with pytest.raises(A__  ):
									logger.info(F"""\n\t{test_subtraction.__name__} with different matrix dims"""  )
									assert matop.subtract(A__,    A__  )




@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      __magic_name__							(					A						:   Any,    A						:   Union[str, Any]  ):






			'''simple docstring'''







			if (np.array(A__  )).shape < (2, 2) or (np.array(A__  )).shape < (2, 2):
						logger.info(F"""\n\t{test_multiplication.__name__} returned integer"""  )
						with pytest.raises(A__  ):
									matop.add(A__,    A__  )
			elif (np.array(A__  )).shape == (np.array(A__  )).shape:
						logger.info(F"""\n\t{test_multiplication.__name__} meets dim requirements"""  )
						a       =     (np.matmul(A__,    A__  )).tolist()
						a       =     matop.multiply(A__,    A__  )
						assert theo == act
			else:
						with pytest.raises(A__  ):
									logger.info(
									    F"""\n\t{test_multiplication.__name__} does not meet dim requirements"""  )
									assert matop.subtract(A__,    A__  )




@pytest.mark.mat_ops
def      __magic_name__							(					):






			'''simple docstring'''







			a       =     (3.5 * np.array(A__  )).tolist()
			a       =     matop.scalar_multiply(A__,    3.5  )
			assert theo == act




@pytest.mark.mat_ops
def      __magic_name__							(					):






			'''simple docstring'''







			a       =     (np.identity(5  )).tolist()
			a       =     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      __magic_name__							(					A						:   List[Any]  ):






			'''simple docstring'''







			if (np.array(A__  )).shape < (2, 2):
						with pytest.raises(A__  ):
									logger.info(F"""\n\t{test_transpose.__name__} returned integer"""  )
									matop.transpose(A__  )
			else:
						a       =     (np.transpose(A__  )).tolist()
						a       =     matop.transpose(A__,    return_map=A__  )
						assert theo == act










import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

_snake_case				=			[[1_2, 1_0], [3, 9]]
_snake_case				=			[[3, 4], [7, 4]]
_snake_case				=			[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
_snake_case				=			[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
_snake_case				=			[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
_snake_case				=			[1]
_snake_case				=			[2]

_snake_case				=			logging.getLogger()
_snake_case				=			logging.DEBUG
_snake_case				=			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 (		A__		,		A__			):
     if (np.array(A__			)).shape < (2, 2) or (np.array(A__			)).shape < (2, 2):
          with pytest.raises(A__			):
               logger.info(f'\n\t{test_addition.__name__} returned integer'			)
               matop.add(A__		,		A__			)
     elif (np.array(A__			)).shape == (np.array(A__			)).shape:
          logger.info(f'\n\t{test_addition.__name__} with same matrix dims'			)
          UpperCAmelCase    :					Tuple			=      (np.array(A__			) + np.array(A__			)).tolist()
          UpperCAmelCase    :					Optional[Any]			=      matop.add(A__		,		A__			)
          assert theo == act
     else:
          with pytest.raises(A__			):
               logger.info(f'\n\t{test_addition.__name__} with different matrix dims'			)
               matop.add(A__		,		A__			)







@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 (		A__		,		A__			):
     if (np.array(A__			)).shape < (2, 2) or (np.array(A__			)).shape < (2, 2):
          with pytest.raises(A__			):
               logger.info(f'\n\t{test_subtraction.__name__} returned integer'			)
               matop.subtract(A__		,		A__			)
     elif (np.array(A__			)).shape == (np.array(A__			)).shape:
          logger.info(f'\n\t{test_subtraction.__name__} with same matrix dims'			)
          UpperCAmelCase    :					Tuple			=      (np.array(A__			) - np.array(A__			)).tolist()
          UpperCAmelCase    :					Optional[int]			=      matop.subtract(A__		,		A__			)
          assert theo == act
     else:
          with pytest.raises(A__			):
               logger.info(f'\n\t{test_subtraction.__name__} with different matrix dims'			)
               assert matop.subtract(A__		,		A__			)







@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 (		A__		,		A__			):
     if (np.array(A__			)).shape < (2, 2) or (np.array(A__			)).shape < (2, 2):
          logger.info(f'\n\t{test_multiplication.__name__} returned integer'			)
          with pytest.raises(A__			):
               matop.add(A__		,		A__			)
     elif (np.array(A__			)).shape == (np.array(A__			)).shape:
          logger.info(f'\n\t{test_multiplication.__name__} meets dim requirements'			)
          UpperCAmelCase    :					List[str]			=      (np.matmul(A__		,		A__			)).tolist()
          UpperCAmelCase    :					int			=      matop.multiply(A__		,		A__			)
          assert theo == act
     else:
          with pytest.raises(A__			):
               logger.info(
                   f'\n\t{test_multiplication.__name__} does not meet dim requirements'			)
               assert matop.subtract(A__		,		A__			)







@pytest.mark.mat_ops
def 	A (		):
     UpperCAmelCase    :					int			=      (3.5 * np.array(A__			)).tolist()
     UpperCAmelCase    :					Optional[int]			=      matop.scalar_multiply(A__		,		3.5			)
     assert theo == act







@pytest.mark.mat_ops
def 	A (		):
     UpperCAmelCase    :					List[Any]			=      (np.identity(5			)).tolist()
     UpperCAmelCase    :					Optional[int]			=      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 (		A__			):
     if (np.array(A__			)).shape < (2, 2):
          with pytest.raises(A__			):
               logger.info(f'\n\t{test_transpose.__name__} returned integer'			)
               matop.transpose(A__			)
     else:
          UpperCAmelCase    :					Dict			=      (np.transpose(A__			)).tolist()
          UpperCAmelCase    :					List[str]			=      matop.transpose(A__		,		return_map=A__			)
          assert theo == act



