
import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

__SCREAMING_SNAKE_CASE     :				Tuple      					=       [[12, 10], [3, 9]]
__SCREAMING_SNAKE_CASE     :				int      					=       [[3, 4], [7, 4]]
__SCREAMING_SNAKE_CASE     :				str      					=       [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
__SCREAMING_SNAKE_CASE     :				Optional[Any]      					=       [[3, 0, -2], [2, 0, 2], [0, 1, 1]]
__SCREAMING_SNAKE_CASE     :				List[str]      					=       [[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
__SCREAMING_SNAKE_CASE     :				List[str]      					=       [1]
__SCREAMING_SNAKE_CASE     :				int      					=       [2]

__SCREAMING_SNAKE_CASE     :				str      					=       logging.getLogger()
__SCREAMING_SNAKE_CASE     :				List[Any]      					=       logging.DEBUG
__SCREAMING_SNAKE_CASE     :				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       UpperCAmelCase__							(    __magic_name__  :       Tuple							,					__magic_name__  :       Dict					):


					'''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'''					)
										lowerCAmelCase						:   Union[str, Any]							=       (np.array(UpperCamelCase_					) + np.array(UpperCamelCase_					)).tolist()
										lowerCAmelCase						:   str							=       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       UpperCAmelCase__							(    __magic_name__  :       Dict							,					__magic_name__  :       List[Any]					):


					'''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'''					)
										lowerCAmelCase						:   Dict							=       (np.array(UpperCamelCase_					) - np.array(UpperCamelCase_					)).tolist()
										lowerCAmelCase						:   Optional[Any]							=       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       UpperCAmelCase__							(    __magic_name__  :       Union[str, Any]							,					__magic_name__  :       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'''					)
										lowerCAmelCase						:   Optional[int]							=       (np.matmul(UpperCamelCase_							,					UpperCamelCase_					)).tolist()
										lowerCAmelCase						:   Dict							=       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       UpperCAmelCase__							(    ):


					'''simple docstring'''

					lowerCAmelCase						:   Union[str, Any]							=       (3.5 * np.array(UpperCamelCase_					)).tolist()
					lowerCAmelCase						:   str							=       matop.scalar_multiply(UpperCamelCase_							,					3.5					)
					assert theo == act
@pytest.mark.mat_ops
def       UpperCAmelCase__							(    ):


					'''simple docstring'''

					lowerCAmelCase						:   List[Any]							=       (np.identity(5					)).tolist()
					lowerCAmelCase						:   Any							=       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       UpperCAmelCase__							(    __magic_name__  :       Union[str, 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:
										lowerCAmelCase						:   List[Any]							=       (np.transpose(UpperCamelCase_					)).tolist()
										lowerCAmelCase						:   Tuple							=       matop.transpose(UpperCamelCase_							,					return_map=UpperCamelCase_					)
										assert theo == act


def       UpperCAmelCase__							(    __magic_name__  :       Union[str, Any]							,					__magic_name__  :       int					):


					'''simple docstring'''

					sequence.append(__magic_name__					)

					lowerCAmelCase						:   Tuple							=       0
					while sequence[index] != target:
										index += 1

					sequence.pop()

					if index == len(__magic_name__					):
										return None

					return index


if __name__ == "__main__":
		__SCREAMING_SNAKE_CASE     :				Dict             =       input('Enter numbers separated by comma:\n').strip()
		__SCREAMING_SNAKE_CASE     :				int             =       [int(item) for item in user_input.split(',')]

		__SCREAMING_SNAKE_CASE     :				str             =       input('Enter a single number to be found in the list:\n')
		__SCREAMING_SNAKE_CASE     :				Tuple             =       int(target_input)
		__SCREAMING_SNAKE_CASE     :				Union[str, Any]             =       sentinel_linear_search(sequence, target)
		if result is not None:
				print(f"""{target} found at positions: {result}""")
		else:
				print('Not found')
