code: 
  
  
  '''simple docstring'''
  
  
  
  
  
  from __future__ import annotations
  
  from typing import Any
  
  
  
  
  
  
  def 	UpperCAmelCase__(							*_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			if all(_check_not_integer(_SCREAMING_SNAKE_CASE   ) for m in matrix_s   ):
  						for i in matrix_s[1:]:
  									_verify_matrix_sizes(matrix_s[0],_SCREAMING_SNAKE_CASE   )
  						return [[sum(_SCREAMING_SNAKE_CASE   ) for t in zip(*_SCREAMING_SNAKE_CASE   )] for m in zip(*_SCREAMING_SNAKE_CASE   )]
  			raise TypeError('Expected a matrix, got int/list instead'   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]],_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			if (
  			    _check_not_integer(_SCREAMING_SNAKE_CASE   )
  			    and _check_not_integer(_SCREAMING_SNAKE_CASE   )
  			    and _verify_matrix_sizes(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   )
  			):
  						return [[i - j for i, j in zip(*_SCREAMING_SNAKE_CASE   )] for m in zip(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   )]
  			raise TypeError('Expected a matrix, got int/list instead'   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]],_SCREAMING_SNAKE_CASE				:   int | float   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			return [[x * n for x in row] for row in matrix]
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]],_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			if _check_not_integer(_SCREAMING_SNAKE_CASE   ) and _check_not_integer(_SCREAMING_SNAKE_CASE   ):
  						__A,  __A=  _verify_matrix_sizes(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   )
  
  			if cols[0] != rows[1]:
  						__A=  (
  						    'Cannot multiply matrix of dimensions '
  						    f"""({rows[0]},{cols[0]}) and ({rows[1]},{cols[1]})"""
  						)
  						raise ValueError(_SCREAMING_SNAKE_CASE   )
  			return [
  			    [sum(m * n for m, n in zip(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   )   ) for j in zip(*_SCREAMING_SNAKE_CASE   )] for i in matrix_a
  			]
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   int   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  int(_SCREAMING_SNAKE_CASE   )
  			return [[int(row == column   ) for column in range(_SCREAMING_SNAKE_CASE   )] for row in range(_SCREAMING_SNAKE_CASE   )]
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]],_SCREAMING_SNAKE_CASE				:   bool = True   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			if _check_not_integer(_SCREAMING_SNAKE_CASE   ):
  						if return_map:
  									return map(_SCREAMING_SNAKE_CASE,zip(*_SCREAMING_SNAKE_CASE   )   )
  						else:
  									return list(map(_SCREAMING_SNAKE_CASE,zip(*_SCREAMING_SNAKE_CASE   )   )   )
  			raise TypeError('Expected a matrix, got int/list instead'   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]],_SCREAMING_SNAKE_CASE				:   int,_SCREAMING_SNAKE_CASE				:   int   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  matrix[:row] + matrix[row + 1 :]
  			return [row[:column] + row[column + 1 :] for row in minor]
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			if len(_SCREAMING_SNAKE_CASE   ) == 1:
  						return matrix[0][0]
  
  			return sum(
  			    x * determinant(minor(_SCREAMING_SNAKE_CASE,0,_SCREAMING_SNAKE_CASE   )   ) * (-1) ** i
  			    for i, x in enumerate(matrix[0]   )   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  determinant(_SCREAMING_SNAKE_CASE   )
  			if det == 0:
  						return None
  
  			__A=  [
  			    [determinant(minor(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   )   ) for j in range(len(_SCREAMING_SNAKE_CASE   )   )]
  			    for i in range(len(_SCREAMING_SNAKE_CASE   )   )
  			]
  
  			__A=  [
  			    [x * (-1) ** (row + col) for col, x in enumerate(matrix_minor[row]   )]
  			    for row in range(len(_SCREAMING_SNAKE_CASE   )   )
  			]
  			__A=  list(transpose(_SCREAMING_SNAKE_CASE   )   )
  			return scalar_multiply(_SCREAMING_SNAKE_CASE,1 / det   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			return not isinstance(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   ) and not isinstance(matrix[0],_SCREAMING_SNAKE_CASE   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			return len(_SCREAMING_SNAKE_CASE   ), len(matrix[0]   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   list[list[int]],_SCREAMING_SNAKE_CASE				:   list[list[int]]   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  _shape(_SCREAMING_SNAKE_CASE   ) + _shape(_SCREAMING_SNAKE_CASE   )
  			if shape[0] != shape[3] or shape[1] != shape[2]:
  						__A=  (
  						    'operands could not be broadcast together with shape '
  						    f"""({shape[0], shape[1]}), ({shape[2], shape[3]})"""
  						)
  						raise ValueError(_SCREAMING_SNAKE_CASE   )
  			return (shape[0], shape[2]), (shape[1], shape[3])
  
  
  
  
  
  
  def 	UpperCAmelCase__(							):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  [[12, 10], [3, 9]]
  			__A=  [[3, 4], [7, 4]]
  			__A=  [[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34], [41, 42, 43, 44]]
  			__A=  [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
  			print(f"""Add Operation, {add(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   ) = } \n"""   )
  			print(
  			    f"""Multiply Operation, {multiply(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE   ) = } \n""",)
  			print(f"""Identity: {identity(5   )}\n"""   )
  			print(f"""Minor of {matrix_c} = {minor(_SCREAMING_SNAKE_CASE,1,2   )} \n"""   )
  			print(f"""Determinant of {matrix_b} = {determinant(_SCREAMING_SNAKE_CASE   )} \n"""   )
  			print(f"""Inverse of {matrix_d} = {inverse(_SCREAMING_SNAKE_CASE   )}\n"""   )
  
  
  if __name__ == "__main__":
  		import doctest
  
  		doctest.testmod()
  		main()
  
  
  
  
style_context: 
  
  
  '''simple docstring'''
  
  
  
  
  
  UpperCAmelCase__      =							[[0, 1, 1], [0, 0, 1], [1, 0, 0]]
  class 	a__				:
  
  
  
  
  
  			'''simple docstring'''
  
  			def __init__(     self       : Any ,						lowerCAmelCase_       : Optional[int]  )			->		Tuple:
  						__A=  name
  						__A=  []
  						__A=  []
  			def 				lowerCAmelCase    (     self       : Any ,						lowerCAmelCase_       : Dict  )			->		Any:
  						self.inbound.append(lowerCAmelCase_  )
  			def 				lowerCAmelCase    (     self       : str ,						lowerCAmelCase_       : Any  )			->		List[Any]:
  						self.outbound.append(lowerCAmelCase_  )
  
  			def __repr__(     self       : int  )			->		Union[str, Any]:
  						return F"""<node={self.name} inbound={self.inbound} outbound={self.outbound}>"""
  
  
  
  
  
  
  def 	UpperCAmelCase__(							_SCREAMING_SNAKE_CASE				:   Any,_SCREAMING_SNAKE_CASE				:   Optional[int]=3,_SCREAMING_SNAKE_CASE				:   Dict=0.85   ):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  {}
  			for node in nodes:
  						__A=  1
  
  			__A=  {}
  			for node in nodes:
  						__A=  len(node.outbound   )
  
  			for i in range(_SCREAMING_SNAKE_CASE   ):
  						print(f"""======= Iteration {i + 1} ======="""   )
  						for _, node in enumerate(_SCREAMING_SNAKE_CASE   ):
  									__A=  (1 - d) + d * sum(
  									    ranks[ib] / outbounds[ib] for ib in node.inbound   )
  						print(_SCREAMING_SNAKE_CASE   )
  
  
  
  
  
  
  def 	UpperCAmelCase__(							):
  
  
  
  
  
  
  			"""simple docstring"""
  
  
  
  
  			__A=  list(input('Enter Names of the Nodes: '   ).split()   )
  
  			__A=  [Node(_SCREAMING_SNAKE_CASE   ) for name in names]
  
  			for ri, row in enumerate(_SCREAMING_SNAKE_CASE   ):
  						for ci, col in enumerate(_SCREAMING_SNAKE_CASE   ):
  									if col == 1:
  												nodes[ci].add_inbound(names[ri]   )
  												nodes[ri].add_outbound(names[ci]   )
  
  			print('======= Nodes ======='   )
  			for node in nodes:
  						print(_SCREAMING_SNAKE_CASE   )
  
  			page_rank(_SCREAMING_SNAKE_CASE   )
  
  
  if __name__ == "__main__":
  					main()
  
  
  
  