"""simple docstring"""







import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

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

_a	:	Any=					logging.getLogger()
_a	:	Any=					logging.DEBUG
_a	:	str=					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							(       UpperCAmelCase_       :							str     ,				UpperCAmelCase_       :							Tuple    )				->     Optional[Any]:

	'''simple docstring'''





	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"    )
		__snake_case     :				Optional[Any] 						=					(np.array(_lowercase    ) + np.array(_lowercase    )).tolist()
		__snake_case     :				Any 						=					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     __UpperCAmelCase							(       UpperCAmelCase_       :							Dict     ,				UpperCAmelCase_       :							Optional[Any]    )				->     Optional[Any]:

	'''simple docstring'''





	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"    )
		__snake_case     :				int 						=					(np.array(_lowercase    ) - np.array(_lowercase    )).tolist()
		__snake_case     :				int 						=					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     __UpperCAmelCase							(       UpperCAmelCase_       :							Union[str, Any]     ,				UpperCAmelCase_       :							Any    )				->     List[Any]:

	'''simple docstring'''





	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"    )
		__snake_case     :				Any 						=					(np.matmul(_lowercase     ,				_lowercase    )).tolist()
		__snake_case     :				Tuple 						=					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     __UpperCAmelCase							(       )				->     Union[str, Any]:

	'''simple docstring'''





	__snake_case     :				int 						=					(3.5 * np.array(_lowercase    )).tolist()
	__snake_case     :				int 						=					matop.scalar_multiply(_lowercase     ,				3.5    )
	assert theo == act
@pytest.mark.mat_ops
def     __UpperCAmelCase							(       )				->     Tuple:

	'''simple docstring'''





	__snake_case     :				Union[str, Any] 						=					(np.identity(5    )).tolist()
	__snake_case     :				Tuple 						=					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							(       UpperCAmelCase_       :							str    )				->     List[str]:

	'''simple docstring'''





	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:
		__snake_case     :				Optional[int] 						=					(np.transpose(_lowercase    )).tolist()
		__snake_case     :				Dict 						=					matop.transpose(_lowercase     ,				return_map=_lowercase    )
		assert theo == act










'''simple docstring'''




class      UpperCamelCase_					:





	def __init__(    self       )     ->     None:
								UpperCAmelCase	:						int					=						[0, 1]






	def 					_lowercase(    self						,						A       )     ->     list:
								if (difference := index - (len(self.sequence       ) - 2)) >= 1:
															for _ in range(A       ):
																						self.sequence.append(self.sequence[-1] + self.sequence[-2]       )
								return self.sequence[:index]




def  __lowerCamelCase    (   ) ->     None:
							print(
							    """Fibonacci Series Using Dynamic Programming\n"""      ,							"""Enter the index of the Fibonacci number you want to calculate """      ,							"""in the prompt below. (To exit enter exit or Ctrl-C)\n"""      ,							sep=""""""      ,							)
							UpperCAmelCase	:						Tuple					=						Fibonacci()

							while True:
														UpperCAmelCase	:						str					=						input(""">> """						)
														if prompt in {"exit", "quit"}:
																					break

														try:
																					UpperCAmelCase	:						int					=						int(_lowercase						)
														except ValueError:
																					print("""Enter a number or 'exit'"""						)
																					continue

														print(fibonacci.get(_lowercase						)						)


if __name__ == "__main__":
							main()

