




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__":
						UpperCamelCase__ :   Union[str, Any]						=							'''%20'''.join(argv[1:]) if len(argv) > 1 else quote(str(input('''Search: ''')))

						print('''Googling.....''')

						UpperCamelCase__ :   Optional[int]						=							F"""https://www.google.com/search?q={query}&num=100"""

						UpperCamelCase__ :   Any						=							requests.get(
						    url,
						    headers={'''User-Agent''': str(UserAgent().random)},
						)

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

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

						webbrowser.open(link)







"""simple docstring"""




from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import torch

from ...utils import BaseOutput, OptionalDependencyNotAvailable, is_torch_available, is_transformers_available




@dataclass
class 			__snake_case   (lowerCamelCase  ):
							__a					 =       42


try:
					if not (is_transformers_available() and is_torch_available()):
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
					from .pipeline_text_to_video_synth import TextToVideoSDPipeline
					from .pipeline_text_to_video_synth_imgaimg import VideoToVideoSDPipeline  # noqa: F401
					from .pipeline_text_to_video_zero import TextToVideoZeroPipeline




