




import json
from typing import List, Optional, Tuple

from tokenizers import normalizers
from tokenizers.pre_tokenizers import BertPreTokenizer, PreTokenizer

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_roformer import RoFormerTokenizer
from .tokenization_utils import JiebaPreTokenizer


a_   		=     logging.get_logger(__name__)

a_   		=     {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

a_   		=     {
    "vocab_file": {
        "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/vocab.txt",
        "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/vocab.txt",
        "junnyu/roformer_chinese_char_small": (
            "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/vocab.txt"
        ),
        "junnyu/roformer_chinese_char_base": (
            "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/vocab.txt"
        ),
        "junnyu/roformer_small_discriminator": (
            "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/vocab.txt"
        ),
        "junnyu/roformer_small_generator": (
            "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/vocab.txt"
        ),
    }
}

a_   		=     {
    "junnyu/roformer_chinese_small": 1536,
    "junnyu/roformer_chinese_base": 1536,
    "junnyu/roformer_chinese_char_small": 512,
    "junnyu/roformer_chinese_char_base": 512,
    "junnyu/roformer_small_discriminator": 128,
    "junnyu/roformer_small_generator": 128,
}


a_   		=     {
    "junnyu/roformer_chinese_small": {"do_lower_case": True},
    "junnyu/roformer_chinese_base": {"do_lower_case": True},
    "junnyu/roformer_chinese_char_small": {"do_lower_case": True},
    "junnyu/roformer_chinese_char_base": {"do_lower_case": True},
    "junnyu/roformer_small_discriminator": {"do_lower_case": True},
    "junnyu/roformer_small_generator": {"do_lower_case": True},
}

class  _lowerCamelCase						(			_SCREAMING_SNAKE_CASE   ):

      """simple docstring"""

      lowerCAmelCase__			: Dict    =					VOCAB_FILES_NAMES
      lowerCAmelCase__			: Any    =					PRETRAINED_VOCAB_FILES_MAP
      lowerCAmelCase__			: Dict    =					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      lowerCAmelCase__			: str    =					PRETRAINED_INIT_CONFIGURATION
      lowerCAmelCase__			: List[str]    =					RoFormerTokenizer







      def __init__(     self					: int ,       snake_case					: Dict=None ,       snake_case					: Union[str, Any]=None ,       snake_case					: List[str]=True ,       snake_case					: str="[UNK]" ,       snake_case					: int="[SEP]" ,       snake_case					: Any="[PAD]" ,       snake_case					: Any="[CLS]" ,       snake_case					: str="[MASK]" ,       snake_case					: str=True ,       snake_case					: Union[str, Any]=None ,       **snake_case					: int ,       ):
          super().__init__(
              snake_case ,       tokenizer_file=snake_case ,       do_lower_case=snake_case ,       unk_token=snake_case ,       sep_token=snake_case ,       pad_token=snake_case ,       cls_token=snake_case ,       mask_token=snake_case ,       tokenize_chinese_chars=snake_case ,       strip_accents=snake_case ,       **snake_case ,       )

          __UpperCamelCase  		=						json.loads(self.backend_tokenizer.normalizer.__getstate__()				)
          if (
              pre_tok_state.get('''lowercase''' ,       snake_case				) != do_lower_case
              or pre_tok_state.get('''strip_accents''' ,       snake_case				) != strip_accents
          ):
              __UpperCamelCase  		=						getattr(snake_case ,       pre_tok_state.pop('''type'''				)				)
              __UpperCamelCase  		=						do_lower_case
              __UpperCamelCase  		=						strip_accents
              __UpperCamelCase  		=						pre_tok_class(**snake_case				)

          __UpperCamelCase  		=						do_lower_case







      def __getstate__(     self					: List[str]				):
          __UpperCamelCase  		=						self.__dict__.copy()
          __UpperCamelCase  		=						BertPreTokenizer()
          return state







      def __setstate__(     self					: Optional[int] ,       snake_case					: Optional[Any]				):
          __UpperCamelCase  		=						d
          __UpperCamelCase  		=						self.__dict__['''_tokenizer'''].get_vocab()
          __UpperCamelCase  		=						PreTokenizer.custom(JiebaPreTokenizer(snake_case				)				)







      def       snake_case	(     self					: Union[str, Any] ,       snake_case					: List[Any] ,       snake_case					: Union[str, Any]=None				):
          __UpperCamelCase  		=						[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       snake_case	(     self					: Dict ,       snake_case					: List[int] ,       snake_case					: Optional[List[int]] = None				):
          __UpperCamelCase  		=						[self.sep_token_id]
          __UpperCamelCase  		=						[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       snake_case	(     self					: Tuple ,       snake_case					: str ,       snake_case					: Optional[str] = None				):
          __UpperCamelCase  		=						self._tokenizer.model.save(snake_case ,       name=snake_case				)
          return tuple(snake_case				)







      def       snake_case	(     self					: Optional[Any] ,       snake_case					: Tuple ,       snake_case					: int=None ,       snake_case					: Optional[int]=None ,       snake_case					: Any=False ,       **snake_case					: List[Any] ,       ):
          __UpperCamelCase  		=						BertPreTokenizer()
          return super().save_pretrained(snake_case ,       snake_case ,       snake_case ,       snake_case ,       **snake_case				)












import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
 print("Googling.....")
 a_   		=     "https://www.google.com/search?q=" + " ".join(sys.argv[1:])
 a_   		=     requests.get(url, headers={"UserAgent": UserAgent().random})
 # res.raise_for_status()
 with open("project1a.html", "wb") as out_file:  # only for knowing the class
  for data in res.iter_content(1_0000):
   out_file.write(data)
 a_   		=     BeautifulSoup(res.text, "html.parser")
 a_   		=     list(soup.select(".eZt8xd"))[:5]

 print(len(links))
 for link in links:
  if link.text == "Maps":
   webbrowser.open(link.get("href"))
  else:
   webbrowser.open(f"""https://google.com{link.get('href')}""")






