code: 
  
  
  
  
  
  
  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__		:       List[Any]   							=							[[12, 10], [3, 9]]
  SCREAMING_SNAKE_CASE__		:       Any   							=							[[3, 4], [7, 4]]
  SCREAMING_SNAKE_CASE__		:       List[Any]   							=							[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
  SCREAMING_SNAKE_CASE__		:       int   							=							[[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__		:       Dict   							=							[2]
  
  SCREAMING_SNAKE_CASE__		:       Optional[Any]   							=							logging.getLogger()
  SCREAMING_SNAKE_CASE__		:       str   							=							logging.DEBUG
  SCREAMING_SNAKE_CASE__		:       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    _lowerCamelCase	(	__lowerCamelCase   ,       __lowerCamelCase					)   -> Optional[int]:
  
       '''simple docstring'''
       if (np.array(__lowerCamelCase					)).shape < (2, 2) or (np.array(__lowerCamelCase					)).shape < (2, 2):
            with pytest.raises(__lowerCamelCase					):
                 logger.info(F"\n\t{test_addition.__name__} returned integer"					)
                 matop.add(__lowerCamelCase   ,       __lowerCamelCase					)
       elif (np.array(__lowerCamelCase					)).shape == (np.array(__lowerCamelCase					)).shape:
            logger.info(F"\n\t{test_addition.__name__} with same matrix dims"					)
            UpperCAmelCase__			:     Optional[Any]										= (np.array(__lowerCamelCase					) + np.array(__lowerCamelCase					)).tolist()
            UpperCAmelCase__			:     Optional[int]										= matop.add(__lowerCamelCase   ,       __lowerCamelCase					)
            assert theo == act
       else:
            with pytest.raises(__lowerCamelCase					):
                 logger.info(F"\n\t{test_addition.__name__} with different matrix dims"					)
                 matop.add(__lowerCamelCase   ,       __lowerCamelCase					)
  
  
  
  
  
  @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	(	__lowerCamelCase   ,       __lowerCamelCase					)   -> Tuple:
  
       '''simple docstring'''
       if (np.array(__lowerCamelCase					)).shape < (2, 2) or (np.array(__lowerCamelCase					)).shape < (2, 2):
            with pytest.raises(__lowerCamelCase					):
                 logger.info(F"\n\t{test_subtraction.__name__} returned integer"					)
                 matop.subtract(__lowerCamelCase   ,       __lowerCamelCase					)
       elif (np.array(__lowerCamelCase					)).shape == (np.array(__lowerCamelCase					)).shape:
            logger.info(F"\n\t{test_subtraction.__name__} with same matrix dims"					)
            UpperCAmelCase__			:     Optional[int]										= (np.array(__lowerCamelCase					) - np.array(__lowerCamelCase					)).tolist()
            UpperCAmelCase__			:     List[Any]										= matop.subtract(__lowerCamelCase   ,       __lowerCamelCase					)
            assert theo == act
       else:
            with pytest.raises(__lowerCamelCase					):
                 logger.info(F"\n\t{test_subtraction.__name__} with different matrix dims"					)
                 assert matop.subtract(__lowerCamelCase   ,       __lowerCamelCase					)
  
  
  
  
  
  @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	(	__lowerCamelCase   ,       __lowerCamelCase					)   -> Tuple:
  
       '''simple docstring'''
       if (np.array(__lowerCamelCase					)).shape < (2, 2) or (np.array(__lowerCamelCase					)).shape < (2, 2):
            logger.info(F"\n\t{test_multiplication.__name__} returned integer"					)
            with pytest.raises(__lowerCamelCase					):
                 matop.add(__lowerCamelCase   ,       __lowerCamelCase					)
       elif (np.array(__lowerCamelCase					)).shape == (np.array(__lowerCamelCase					)).shape:
            logger.info(F"\n\t{test_multiplication.__name__} meets dim requirements"					)
            UpperCAmelCase__			:     List[Any]										= (np.matmul(__lowerCamelCase   ,       __lowerCamelCase					)).tolist()
            UpperCAmelCase__			:     Dict										= matop.multiply(__lowerCamelCase   ,       __lowerCamelCase					)
            assert theo == act
       else:
            with pytest.raises(__lowerCamelCase					):
                 logger.info(
                     F"\n\t{test_multiplication.__name__} does not meet dim requirements"					)
                 assert matop.subtract(__lowerCamelCase   ,       __lowerCamelCase					)
  
  
  
  
  
  @pytest.mark.mat_ops
  def    _lowerCamelCase	(	)   -> Dict:
  
       '''simple docstring'''
       UpperCAmelCase__			:     Optional[Any]										= (3.5 * np.array(__lowerCamelCase					)).tolist()
       UpperCAmelCase__			:     Tuple										= matop.scalar_multiply(__lowerCamelCase   ,       3.5					)
       assert theo == act
  
  
  
  
  
  @pytest.mark.mat_ops
  def    _lowerCamelCase	(	)   -> int:
  
       '''simple docstring'''
       UpperCAmelCase__			:     Any										= (np.identity(5					)).tolist()
       UpperCAmelCase__			:     str										= 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	(	__lowerCamelCase					)   -> Optional[Any]:
  
       '''simple docstring'''
       if (np.array(__lowerCamelCase					)).shape < (2, 2):
            with pytest.raises(__lowerCamelCase					):
                 logger.info(F"\n\t{test_transpose.__name__} returned integer"					)
                 matop.transpose(__lowerCamelCase					)
       else:
            UpperCAmelCase__			:     Union[str, Any]										= (np.transpose(__lowerCamelCase					)).tolist()
            UpperCAmelCase__			:     str										= matop.transpose(__lowerCamelCase   ,       return_map=__lowerCamelCase					)
            assert theo == act
  
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  
  import random
  
  
  
  
  
  
  
  class 							UpperCAmelCase_     :
  
  
  
  
       def __init__(							self  ,	_lowerCAmelCase  ,	_lowerCAmelCase		):
            UpperCAmelCase__			:     Union[str, Any]										= x
            UpperCAmelCase__			:     Union[str, Any]										= y
  
  
  
  
       def      __UpperCAmelCase     (							self		):
            return (self.x**2 + self.y**2) <= 1
  
  
  
  
       @classmethod
       def      __UpperCAmelCase     (							cls		):
            return cls(x=random.random()  ,	y=random.random()		)
  
  
  
  
  
  def    _lowerCamelCase	(	__lowerCamelCase					)   -> float:
  
       '''simple docstring'''
       if number_of_simulations < 1:
            raise ValueError("""At least one simulation is necessary to estimate PI."""					)
  
       UpperCAmelCase__			:     Dict										= 0
       for _ in range(__lowerCamelCase					):
            UpperCAmelCase__			:     Union[str, Any]										= Point.random_unit_square()
  
            if random_point.is_in_unit_circle():
                 number_in_unit_circle += 1
  
       return 4 * number_in_unit_circle / number_of_simulations
  
  
  if __name__ == "__main__":
        # import doctest
  
        # doctest.testmod()
        from math import pi
  
        SCREAMING_SNAKE_CASE__		:       List[str]   							=							"""Please enter the desired number of Monte Carlo simulations: """
        SCREAMING_SNAKE_CASE__		:       int   							=							estimate_pi(int(input(prompt).strip()))
        print(f'''An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}''')
  
  
  
  
  
  
  