




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

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






			'''simple docstring'''







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




@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						:   int,    A						:   Optional[int]  ):






			'''simple docstring'''







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




@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						:   str,    A						:   Optional[int]  ):






			'''simple docstring'''







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




@pytest.mark.mat_ops
def      __magic_name__							(					):






			'''simple docstring'''







			a       =     (3.5 * np.array(__UpperCamelCase  )).tolist()
			a       =     matop.scalar_multiply(__UpperCamelCase,    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						:   Optional[Any]  ):






			'''simple docstring'''







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








"""simple docstring"""


from ..utils import DummyObject, requires_backends


__A					=			None



def        _lowerCamelCase(*__UpperCamelCase       ,					**__UpperCamelCase			)							->					Tuple:
	requires_backends(__UpperCamelCase       ,					["""sentencepiece""", """tokenizers"""]			)



