




import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
			from transformers import AutoModelForSeqaSeqLM, AutoTokenizer






@require_torch
@require_sentencepiece
@require_tokenizers
class  __magic_name__						(  unittest.TestCase):
				'''simple docstring'''







				@slow
				def     _A							(							self:   str		):
											SCREAMING_SNAKE_CASE_   	=    AutoModelForSeqaSeqLM.from_pretrained('''google/mt5-small'''		,					return_dict=_lowerCamelCase		).to(_lowerCamelCase		)
											SCREAMING_SNAKE_CASE_   	=    AutoTokenizer.from_pretrained('''google/mt5-small'''		)

											SCREAMING_SNAKE_CASE_   	=    tokenizer('''Hello there'''		,					return_tensors='''pt'''		).input_ids
											SCREAMING_SNAKE_CASE_   	=    tokenizer('''Hi I am'''		,					return_tensors='''pt'''		).input_ids

											SCREAMING_SNAKE_CASE_   	=    model(input_ids.to(_lowerCamelCase		)		,					labels=labels.to(_lowerCamelCase		)		).loss
											SCREAMING_SNAKE_CASE_   	=    -(labels.shape[-1] * loss.item())

											SCREAMING_SNAKE_CASE_   	=    -84.91_27
											self.assertTrue(abs(mtf_score - EXPECTED_SCORE		) < 1E-4		)








import webbrowser
from sys import argv
from urllib.parse import parse_qs, quote

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
			__SCREAMING_SNAKE_CASE 						="""%20""".join(argv[1:]) if len(argv) > 1 else quote(str(input("""Search: """)))

			print("""Googling.....""")

			__SCREAMING_SNAKE_CASE 						=f"""https://www.google.com/search?q={query}&num=100"""

			__SCREAMING_SNAKE_CASE 						=requests.get(
			    url,
			    headers={"""User-Agent""": str(UserAgent().random)},
			)

			try:
						__SCREAMING_SNAKE_CASE 						=(
						    BeautifulSoup(res.text, """html.parser""")
						    .find("""div""", attrs={"""class""": """yuRUbf"""})
						    .find("""a""")
						    .get("""href""")
						)

			except AttributeError:
						__SCREAMING_SNAKE_CASE 						=parse_qs(
						    BeautifulSoup(res.text, """html.parser""")
						    .find("""div""", attrs={"""class""": """kCrYT"""})
						    .find("""a""")
						    .get("""href""")
						)["""url"""][0]

			webbrowser.open(link)


