



"""simple docstring"""
import json
import os
import unittest

from transformers.models.ctrl.tokenization_ctrl import VOCAB_FILES_NAMES, CTRLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin



class    SCREAMING_SNAKE_CASE__						(      UpperCAmelCase__   ,    unittest.TestCase				):
   __lowerCAmelCase						:     Tuple		=		CTRLTokenizer
   __lowerCAmelCase						:     Optional[Any]		=		False
   __lowerCAmelCase						:     str		=		False

   def 			SCREAMING_SNAKE_CASE  (     self		)						->   List[str]:





    '''simple docstring'''




    super().setUp()

    # Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
    UpperCAmelCase			:      Optional[Any]			=			["""adapt""", """re@@""", """a@@""", """apt""", """c@@""", """t""", """<unk>"""]
    UpperCAmelCase			:      List[Any]			=			dict(zip(_SCREAMING_SNAKE_CASE   ,  range(len(_SCREAMING_SNAKE_CASE		)		)		)		)
    UpperCAmelCase			:      Dict			=			["""#version: 0.2""", """a p""", """ap t</w>""", """r e""", """a d""", """ad apt</w>""", """"""]
    UpperCAmelCase			:      str			=			{"""unk_token""": """<unk>"""}

    UpperCAmelCase			:      Union[str, Any]			=			os.path.join(self.tmpdirname   ,  VOCAB_FILES_NAMES["""vocab_file"""]		)
    UpperCAmelCase			:      Optional[Any]			=			os.path.join(self.tmpdirname   ,  VOCAB_FILES_NAMES["""merges_file"""]		)
    with open(self.vocab_file   ,  """w"""   ,  encoding="""utf-8"""		) as fp:
     fp.write(json.dumps(_SCREAMING_SNAKE_CASE		) + """\n"""		)
    with open(self.merges_file   ,  """w"""   ,  encoding="""utf-8"""		) as fp:
     fp.write("""\n""".join(_SCREAMING_SNAKE_CASE		)		)

   def 			SCREAMING_SNAKE_CASE  (     self   ,  **_SCREAMING_SNAKE_CASE		)						->   Optional[Any]:





    '''simple docstring'''




    kwargs.update(self.special_tokens_map		)
    return CTRLTokenizer.from_pretrained(self.tmpdirname   ,  **_SCREAMING_SNAKE_CASE		)

   def 			SCREAMING_SNAKE_CASE  (     self   ,  _SCREAMING_SNAKE_CASE		)						->   str:





    '''simple docstring'''




    UpperCAmelCase			:      List[Any]			=			"""adapt react readapt apt"""
    UpperCAmelCase			:      Optional[int]			=			"""adapt react readapt apt"""
    return input_text, output_text




   def 			SCREAMING_SNAKE_CASE  (     self		)						->   List[Any]:





    '''simple docstring'''




    UpperCAmelCase			:      Union[str, Any]			=			CTRLTokenizer(self.vocab_file   ,  self.merges_file   ,  **self.special_tokens_map		)
    UpperCAmelCase			:      int			=			"""adapt react readapt apt"""
    UpperCAmelCase			:      Dict			=			"""adapt re@@ a@@ c@@ t re@@ adapt apt""".split()
    UpperCAmelCase			:      List[str]			=			tokenizer.tokenize(_SCREAMING_SNAKE_CASE		)
    self.assertListEqual(_SCREAMING_SNAKE_CASE   ,  _SCREAMING_SNAKE_CASE		)

    UpperCAmelCase			:      Tuple			=			tokens + [tokenizer.unk_token]

    UpperCAmelCase			:      Optional[Any]			=			[0, 1, 2, 4, 5, 1, 0, 3, 6]
    self.assertListEqual(tokenizer.convert_tokens_to_ids(_SCREAMING_SNAKE_CASE		)   ,  _SCREAMING_SNAKE_CASE		)





"""simple docstring"""
import requests
from bsa import BeautifulSoup

def    _snake_case		(		UpperCamelCase		:	str = "AAPL"		):
 UpperCAmelCase			:      Any			=			F"https://in.finance.yahoo.com/quote/{symbol}?s={symbol}"
 UpperCAmelCase			:      Optional[int]			=			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}""")
