


'''simple docstring'''



import requests
from bsa import BeautifulSoup







def       _UpperCamelCase (						UpperCamelCase__ = "AAPL"   ):
			UpperCAmelCase__					:   Optional[Any]       				=       f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
			UpperCAmelCase__					:   Optional[Any]       				=       BeautifulSoup(requests.get(UpperCamelCase__   ).text	, """html.parser"""   )
			UpperCAmelCase__					:   int       				=       """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}""")



'''simple docstring'''



from __future__ import annotations

import unittest

from transformers import is_tf_available
from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow


if is_tf_available():
		import tensorflow as tf

		from transformers import AutoTokenizer, TFAutoModelForSeqaSeqLM


@require_tf
@require_sentencepiece
@require_tokenizers
class 						_snake_case   (       unittest.TestCase		):




					@slow
					def 			snake_case__  ( self):
								UpperCAmelCase__					:   Optional[int]       				=       TFAutoModelForSeqaSeqLM.from_pretrained("""google/mt5-small""")
								UpperCAmelCase__					:   str       				=       AutoTokenizer.from_pretrained("""google/mt5-small""")

								UpperCAmelCase__					:   Optional[Any]       				=       tokenizer("""Hello there"""							,							return_tensors="""tf""").input_ids
								UpperCAmelCase__					:   Tuple       				=       tokenizer("""Hi I am"""							,							return_tensors="""tf""").input_ids

								UpperCAmelCase__					:   List[Any]       				=       model(_lowerCamelCase							,							labels=_lowerCamelCase).loss
								UpperCAmelCase__					:   Tuple       				=       -tf.math.reduce_mean(_lowerCamelCase).numpy()

								UpperCAmelCase__					:   Optional[int]       				=       -21.228168
								self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 2e-4)