


from __future__ import annotations

import math
def 							UpperCamelCase_(					_A :list					,  _A :list	)->		list:
			if len(_A	) != 2 or len(a[0]	) != 2 or len(_A	) != 2 or len(b[0]	) != 2:
						raise Exception("Matrices are not 2x2"	)
			UpperCamelCase__       =							[
			    [a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1]],
			    [a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]],
			]
			return new_matrix
def 							UpperCamelCase_(					_A :list					,  _A :list	)->		str:
			return [
			    [matrix_a[row][col] + matrix_b[row][col] for col in range(len(matrix_a[row]	)	)]
			    for row in range(len(_A	)	)
			]
def 							UpperCamelCase_(					_A :list					,  _A :list	)->		List[str]:
			return [
			    [matrix_a[row][col] - matrix_b[row][col] for col in range(len(matrix_a[row]	)	)]
			    for row in range(len(_A	)	)
			]
def 							UpperCamelCase_(					_A :list	)->		tuple[list, list, list, list]:
			if len(_A	) % 2 != 0 or len(a[0]	) % 2 != 0:
						raise Exception("Odd matrices are not supported!"	)

			UpperCamelCase__       =							len(_A	)
			UpperCamelCase__       =							matrix_length // 2

			UpperCamelCase__       =							[[a[i][j] for j in range(_A					,  _A	)] for i in range(_A	)]
			UpperCamelCase__       =							[
			    [a[i][j] for j in range(_A					,  _A	)] for i in range(_A					,  _A	)
			]

			UpperCamelCase__       =							[[a[i][j] for j in range(_A	)] for i in range(_A	)]
			UpperCamelCase__       =							[[a[i][j] for j in range(_A	)] for i in range(_A					,  _A	)]

			return top_left, top_right, bot_left, bot_right
def 							UpperCamelCase_(					_A :list	)->		tuple[int, int]:
			return len(_A	), len(matrix[0]	)
def 							UpperCamelCase_(					_A :list	)->		None:
			print("\n".join(str(_A	) for line in matrix	)	)
def 							UpperCamelCase_(					_A :list					,  _A :list	)->		list:
			if matrix_dimensions(_A	) == (2, 2):
						return default_matrix_multiplication(_A					,  _A	)

			UpperCamelCase__,   UpperCamelCase__,   UpperCamelCase__,   UpperCamelCase__       =							split_matrix(_A	)
			UpperCamelCase__,   UpperCamelCase__,   UpperCamelCase__,   UpperCamelCase__       =							split_matrix(_A	)

			UpperCamelCase__       =							actual_strassen(_A					,  matrix_subtraction(_A					,  _A	)	)
			UpperCamelCase__       =							actual_strassen(matrix_addition(_A					,  _A	)					,  _A	)
			UpperCamelCase__       =							actual_strassen(matrix_addition(_A					,  _A	)					,  _A	)
			UpperCamelCase__       =							actual_strassen(_A					,  matrix_subtraction(_A					,  _A	)	)
			UpperCamelCase__       =							actual_strassen(matrix_addition(_A					,  _A	)					,  matrix_addition(_A					,  _A	)	)
			UpperCamelCase__       =							actual_strassen(matrix_subtraction(_A					,  _A	)					,  matrix_addition(_A					,  _A	)	)
			UpperCamelCase__       =							actual_strassen(matrix_subtraction(_A					,  _A	)					,  matrix_addition(_A					,  _A	)	)

			UpperCamelCase__       =							matrix_addition(matrix_subtraction(matrix_addition(_A					,  _A	)					,  _A	)					,  _A	)
			UpperCamelCase__       =							matrix_addition(_A					,  _A	)
			UpperCamelCase__       =							matrix_addition(_A					,  _A	)
			UpperCamelCase__       =							matrix_subtraction(matrix_subtraction(matrix_addition(_A					,  _A	)					,  _A	)					,  _A	)

			# construct the new matrix from our 4 quadrants
			UpperCamelCase__       =							[]
			for i in range(len(_A	)	):
						new_matrix.append(top_left[i] + top_right[i]	)
			for i in range(len(_A	)	):
						new_matrix.append(bot_left[i] + bot_right[i]	)
			return new_matrix
def 							UpperCamelCase_(					_A :list					,  _A :list	)->		list:
			if matrix_dimensions(_A	)[1] != matrix_dimensions(_A	)[0]:
						UpperCamelCase__       =							(
						    "Unable to multiply these matrices, please check the dimensions.\n"
						    F'''Matrix A: {matrixa}\n'''
						    F'''Matrix B: {matrixa}'''
						)
						raise Exception(_A	)
			UpperCamelCase__       =							matrix_dimensions(_A	)
			UpperCamelCase__       =							matrix_dimensions(_A	)

			if dimensiona[0] == dimensiona[1] and dimensiona[0] == dimensiona[1]:
						return [matrixa, matrixa]

			UpperCamelCase__       =							max(*_A					,  *_A	)
			UpperCamelCase__       =							int(math.pow(2					,  math.ceil(math.loga(_A	)	)	)	)
			UpperCamelCase__       =							matrixa
			UpperCamelCase__       =							matrixa

			# Adding zeros to the matrices so that the arrays dimensions are the same and also
			# power of 2
			for i in range(0					,  _A	):
						if i < dimensiona[0]:
									for _ in range(dimensiona[1]					,  _A	):
												new_matrixa[i].append(0	)
						else:
									new_matrixa.append([0] * maxim	)
						if i < dimensiona[0]:
									for _ in range(dimensiona[1]					,  _A	):
												new_matrixa[i].append(0	)
						else:
									new_matrixa.append([0] * maxim	)

			UpperCamelCase__       =							actual_strassen(_A					,  _A	)

			# Removing the additional zeros
			for i in range(0					,  _A	):
						if i < dimensiona[0]:
									for _ in range(dimensiona[1]					,  _A	):
												final_matrix[i].pop()
						else:
									final_matrix.pop()
			return final_matrix


if __name__ == "__main__":
						__UpperCamelCase     		=							[
						    [2, 3, 4, 5],
						    [6, 4, 3, 1],
						    [2, 3, 6, 7],
						    [3, 1, 2, 4],
						    [2, 3, 4, 5],
						    [6, 4, 3, 1],
						    [2, 3, 6, 7],
						    [3, 1, 2, 4],
						    [2, 3, 4, 5],
						    [6, 2, 3, 1],
						]
						__UpperCamelCase     		=							[[0, 2, 1, 1], [1_6, 2, 3, 3], [2, 2, 7, 7], [1_3, 1_1, 2_2, 4]]
						print(strassen(matrixa, matrixa))






import requests
from bsa import BeautifulSoup
def 							UpperCamelCase_(					_A :str = "AAPL"	)->		str:
			UpperCamelCase__       =							F'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
			UpperCamelCase__       =							BeautifulSoup(requests.get(_A	).text					,  "html.parser"	)
			UpperCamelCase__       =							"My(6px) Pos(r) smartphone_Mt(6px)"
			return soup.find("div"					,  class_=class_	).find("span"	).text


if __name__ == "__main__":
						for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
												print(f'''Current {symbol:<4} stock price is {stock_price(symbol):>8}''')


