




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

__A						:		int          =						logging.getLogger()
__A						:		str          =						logging.DEBUG
__A						:		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      UpperCAmelCase  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     str:







				'''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					=  (np.array(UpperCamelCase__   ) + np.array(UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  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  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     List[str]:







				'''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					=  (np.array(UpperCamelCase__   ) - np.array(UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  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  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     List[Any]:







				'''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					=  (np.matmul(UpperCamelCase__						,			UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  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  (						)     ->     Dict:







				'''simple docstring'''


				__lowerCAmelCase					=  (3.5 * np.array(UpperCamelCase__   )).tolist()
				__lowerCAmelCase					=  matop.scalar_multiply(UpperCamelCase__						,			3.5   )
				assert theo == act





@pytest.mark.mat_ops
def      UpperCAmelCase  (						)     ->     Union[str, Any]:







				'''simple docstring'''


				__lowerCAmelCase					=  (np.identity(5   )).tolist()
				__lowerCAmelCase					=  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__   )     ->     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					=  (np.transpose(UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  matop.transpose(UpperCamelCase__						,			return_map=UpperCamelCase__   )
								assert theo == act












"""simple docstring"""






from collections import defaultdict

def    __lowerCamelCase     (							SCREAMING_SNAKE_CASE = 5				)		->							int:






       """simple docstring"""




       _UpperCAmelCase			     =  defaultdict(SCREAMING_SNAKE_CASE				)
       _UpperCAmelCase			     =  0

       while True:
              _UpperCAmelCase			     =  get_digits(SCREAMING_SNAKE_CASE				)
              freqs[digits].append(SCREAMING_SNAKE_CASE				)

              if len(freqs[digits]				) == max_base:
                     _UpperCAmelCase			     =  freqs[digits][0] ** 3
                     return base

              num += 1

def    __lowerCamelCase     (							SCREAMING_SNAKE_CASE				)		->							str:






       """simple docstring"""




       return "".join(sorted(str(num**3				)				)				)


if __name__ == "__main__":
    print(F'''{solution() = }''')






