





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__":
  _A					:				Optional[int]				=			"""%20""".join(argv[1:]) if len(argv) > 1 else quote(str(input("""Search: """)))

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

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

  _A					:				Optional[int]				=			requests.get(
      url,
      headers={"""User-Agent""": str(UserAgent().random)},
  )

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

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

  webbrowser.open(link)




'''simple docstring'''
from ...utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_torch_available,
    is_transformers_available,
)


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 .multicontrolnet import MultiControlNetModel
					from .pipeline_controlnet import StableDiffusionControlNetPipeline
					from .pipeline_controlnet_imgaimg import StableDiffusionControlNetImgaImgPipeline
					from .pipeline_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline


if is_transformers_available() and is_flax_available():
					from .pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline


