




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			:	str							     =		[[3, 4], [7, 4]]
__a			:	Any							     =		[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
__a			:	List[Any]							     =		[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
__a			:	Any							     =		[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
__a			:	str							     =		[1]
__a			:	List[str]							     =		[2]

__a			:	List[Any]							     =		logging.getLogger()
__a			:	str							     =		logging.DEBUG
__a			:	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  a_		(							__snake_case     ,		__snake_case					)	->			Optional[int]:

			'''simple docstring'''


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




@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_		(							__snake_case     ,		__snake_case					)	->			Optional[Any]:

			'''simple docstring'''


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




@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_		(							__snake_case     ,		__snake_case					)	->			int:

			'''simple docstring'''


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




@pytest.mark.mat_ops
def  a_		(							)	->			str:

			'''simple docstring'''


			UpperCamelCase_     				= (3.5 * np.array(SCREAMING_SNAKE_CASE_					)).tolist()
			UpperCamelCase_     				= matop.scalar_multiply(SCREAMING_SNAKE_CASE_     ,		3.5					)
			assert theo == act




@pytest.mark.mat_ops
def  a_		(							)	->			str:

			'''simple docstring'''


			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_		(							__snake_case					)	->			List[str]:

			'''simple docstring'''


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


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


lowerCamelCase__        =						{"""configuration_regnet""": ["""REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """RegNetConfig"""]}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__        =						[
					    """REGNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """RegNetForImageClassification""",
					    """RegNetModel""",
					    """RegNetPreTrainedModel""",
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__        =						[
					    """TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """TFRegNetForImageClassification""",
					    """TFRegNetModel""",
					    """TFRegNetPreTrainedModel""",
					]

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__        =						[
					    """FlaxRegNetForImageClassification""",
					    """FlaxRegNetModel""",
					    """FlaxRegNetPreTrainedModel""",
					]


if TYPE_CHECKING:
					from .configuration_regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_regnet import (
										    REGNET_PRETRAINED_MODEL_ARCHIVE_LIST,
										    RegNetForImageClassification,
										    RegNetModel,
										    RegNetPreTrainedModel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_regnet import (
										    TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFRegNetForImageClassification,
										    TFRegNetModel,
										    TFRegNetPreTrainedModel,
										)

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_regnet import (
										    FlaxRegNetForImageClassification,
										    FlaxRegNetModel,
										    FlaxRegNetPreTrainedModel,
										)


else:
					import sys

					lowerCamelCase__        =						_LazyModule(__name__, globals()["""__file__"""], _import_structure)