






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

__A				:				List[str]					=		logging.getLogger()
__A				:				List[Any]					=		logging.DEBUG
__A				:				int					=		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  lowerCamelCase_  (     lowercase__					,  lowercase__):
 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''')
  lowerCamelCase__	=  (np.array(lowercase__) + np.array(lowercase__)).tolist()
  lowerCamelCase__	=  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  lowerCamelCase_  (     lowercase__					,  lowercase__):
 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''')
  lowerCamelCase__	=  (np.array(lowercase__) - np.array(lowercase__)).tolist()
  lowerCamelCase__	=  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  lowerCamelCase_  (     lowercase__					,  lowercase__):
 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''')
  lowerCamelCase__	=  (np.matmul(lowercase__					,  lowercase__)).tolist()
  lowerCamelCase__	=  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  lowerCamelCase_  (     ):
 lowerCamelCase__	=  (3.5 * np.array(lowercase__)).tolist()
 lowerCamelCase__	=  matop.scalar_multiply(lowercase__					,  3.5)
 assert theo == act






@pytest.mark.mat_ops
def  lowerCamelCase_  (     ):
 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  lowerCamelCase_  (     lowercase__):
 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:
  lowerCamelCase__	=  (np.transpose(lowercase__)).tolist()
  lowerCamelCase__	=  matop.transpose(lowercase__					,  return_map=lowercase__)
  assert theo == act









'''simple docstring'''





def  lowerCamelCase_  (     lowercase__					,  lowercase__):
 lowerCamelCase__	=  len(lowercase__)
 lowerCamelCase__	=  len(lowercase__)
 lowerCamelCase__	=  (
     first_input_list_length
     if first_input_list_length > second_input_list_length
     else second_input_list_length
 )
 lowerCamelCase__	=  []
 for char_count in range(lowercase__):
  if char_count < first_input_list_length:
   output_result_list.append(first_input_list[char_count])
  if char_count < second_input_list_length:
   output_result_list.append(second_input_list[char_count])

 return output_result_list


if __name__ == "__main__":
 print(alternative_list_arrange(["""A""", """B""", """C"""], [1, 2, 3, 4, 5]), end=""" """)

