





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_convbert import ConvBertTokenizer


_UpperCAmelCase       =				logging.get_logger(__name__)

_UpperCAmelCase       =				{'vocab_file': 'vocab.txt'}

_UpperCAmelCase       =				{
    'vocab_file': {
        'YituTech/conv-bert-base': 'https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt',
        'YituTech/conv-bert-medium-small': (
            'https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt'
        ),
        'YituTech/conv-bert-small': 'https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt',
    }
}

_UpperCAmelCase       =				{
    'YituTech/conv-bert-base': 512,
    'YituTech/conv-bert-medium-small': 512,
    'YituTech/conv-bert-small': 512,
}


_UpperCAmelCase       =				{
    'YituTech/conv-bert-base': {'do_lower_case': True},
    'YituTech/conv-bert-medium-small': {'do_lower_case': True},
    'YituTech/conv-bert-small': {'do_lower_case': True},
}






class   snake_case_							(						_A		):
  A_     				=       VOCAB_FILES_NAMES
  A_     				=       PRETRAINED_VOCAB_FILES_MAP
  A_     				=       PRETRAINED_INIT_CONFIGURATION
  A_     				=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  A_     				=       ConvBertTokenizer






  def __init__(				self					:	str  ,    _snake_case					:	Union[str, Any]=None  ,    _snake_case					:	int=None  ,    _snake_case					:	Dict=True  ,    _snake_case					:	Any="[UNK]"  ,    _snake_case					:	Optional[Any]="[SEP]"  ,    _snake_case					:	Optional[int]="[PAD]"  ,    _snake_case					:	Optional[Any]="[CLS]"  ,    _snake_case					:	Optional[Any]="[MASK]"  ,    _snake_case					:	Dict=True  ,    _snake_case					:	Any=None  ,    **_snake_case					:	List[str]  ,    )->Tuple:






   '''simple docstring'''

   super().__init__(
       __lowerCAmelCase  ,    tokenizer_file=__lowerCAmelCase  ,    do_lower_case=__lowerCAmelCase  ,    unk_token=__lowerCAmelCase  ,    sep_token=__lowerCAmelCase  ,    pad_token=__lowerCAmelCase  ,    cls_token=__lowerCAmelCase  ,    mask_token=__lowerCAmelCase  ,    tokenize_chinese_chars=__lowerCAmelCase  ,    strip_accents=__lowerCAmelCase  ,    **__lowerCAmelCase  ,    )

   __lowerCAmelCase	:			Union[str, Any]         =  json.loads(self.backend_tokenizer.normalizer.__getstate__()     )
   if (
       normalizer_state.get("""lowercase"""  ,    __lowerCAmelCase     ) != do_lower_case
       or normalizer_state.get("""strip_accents"""  ,    __lowerCAmelCase     ) != strip_accents
       or normalizer_state.get("""handle_chinese_chars"""  ,    __lowerCAmelCase     ) != tokenize_chinese_chars
   ):
    __lowerCAmelCase	:			Tuple         =  getattr(__lowerCAmelCase  ,    normalizer_state.pop("""type"""     )     )
    __lowerCAmelCase	:			Any         =  do_lower_case
    __lowerCAmelCase	:			Dict         =  strip_accents
    __lowerCAmelCase	:			Optional[int]         =  tokenize_chinese_chars
    __lowerCAmelCase	:			Dict         =  normalizer_class(**__lowerCAmelCase     )

   __lowerCAmelCase	:			Any         =  do_lower_case






  def  UpperCAmelCase__		(				self					:	List[str]  ,    _snake_case					:	Any  ,    _snake_case					:	Any=None     )->List[str]:






   '''simple docstring'''

   __lowerCAmelCase	:			Optional[Any]         =  [self.cls_token_id] + token_ids_a + [self.sep_token_id]

   if token_ids_a:
    output += token_ids_a + [self.sep_token_id]

   return output






  def  UpperCAmelCase__		(				self					:	Any  ,    _snake_case					:	List[int]  ,    _snake_case					:	Optional[List[int]] = None     )->List[int]:






   '''simple docstring'''

   __lowerCAmelCase	:			List[Any]         =  [self.sep_token_id]
   __lowerCAmelCase	:			Optional[Any]         =  [self.cls_token_id]
   if token_ids_a is None:
    return len(cls + token_ids_a + sep     ) * [0]
   return len(cls + token_ids_a + sep     ) * [0] + len(token_ids_a + sep     ) * [1]






  def  UpperCAmelCase__		(				self					:	str  ,    _snake_case					:	str  ,    _snake_case					:	Optional[str] = None     )->Tuple[str]:






   '''simple docstring'''

   __lowerCAmelCase	:			str         =  self._tokenizer.model.save(__lowerCAmelCase  ,    name=__lowerCAmelCase     )
   return tuple(__lowerCAmelCase     )




import requests
from bsa import BeautifulSoup

def 	SCREAMING_SNAKE_CASE_							(	_snake_case	:str = "AAPL"				)  ->     str:
   _A      =       F'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
   _A      =       BeautifulSoup(requests.get(_snake_case				).text	,   '''html.parser'''				)
   _A      =       '''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}')



