'''simple docstring'''


from __future__ import annotations

from collections import Counter
from random import random






class 						A   :





							def __init__(      self				:							Union[str, Any]	)							->	str:
								__UpperCAmelCase							=			{}





							def       snake_case__						(      self				:							Any     ,		__a				:							str	)							->	None:
								__UpperCAmelCase							=			{}





							def       snake_case__						(      self				:							Optional[Any]     ,		__a				:							str     ,		__a				:							str     ,		__a				:							float	)							->	None:
								if nodea not in self.connections:
									self.add_node(__a	)
								if nodea not in self.connections:
									self.add_node(__a	)
								__UpperCAmelCase							=			probability





							def       snake_case__						(      self				:							Dict	)							->	list[str]:
								return list(self.connections	)






							def       snake_case__						(      self				:							Any     ,		__a				:							str	)							->	str:
								__UpperCAmelCase							=			0
								__UpperCAmelCase							=			random()

								for dest in self.connections[node]:
									current_probability += self.connections[node][dest]
									if current_probability > random_value:
										return dest
								return ""





def       lowerCAmelCase					(		UpperCamelCase__				:   str    ,					UpperCamelCase__				:   list[tuple[str, str, float]]    ,					UpperCamelCase__				:   int       ):


	"""simple docstring"""
	__UpperCAmelCase							=			MarkovChainGraphUndirectedUnweighted()

	for nodea, nodea, probability in transitions:
		graph.add_transition_probability(UpperCamelCase__    ,					UpperCamelCase__    ,					UpperCamelCase__       )

	__UpperCAmelCase							=			Counter(graph.get_nodes()       )
	__UpperCAmelCase							=			start

	for _ in range(UpperCamelCase__       ):
		__UpperCAmelCase							=			graph.transition(UpperCamelCase__       )
		visited[node] += 1

	return visited


if __name__ == "__main__":
					import doctest

					doctest.testmod()

'''simple docstring'''


import requests
from bsa import BeautifulSoup





def       lowerCAmelCase					(		UpperCamelCase__				:   str = "AAPL"       ):


	"""simple docstring"""
	__UpperCAmelCase							=			f"""https://in.finance.yahoo.com/quote/{symbol}?s={symbol}"""
	__UpperCAmelCase							=			BeautifulSoup(requests.get(UpperCamelCase__       ).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}""")
