




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(10000):
												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")}')





import itertools
import string
from collections.abc import Generator, Iterable




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				Generator[tuple[str, ...], None, None]:
						_UpperCAmelCase      =			iter(snake_case       )
						while True:
												_UpperCAmelCase      =			tuple(itertools.islice(snake_case			,     snake_case       )       )
												if not chunk:
																		return
												yield chunk




def        _SCREAMING_SNAKE_CASE      (		snake_case       )						->				str:
						_UpperCAmelCase      =			"""""".join([c.upper() for c in dirty if c in string.ascii_letters]       )
						_UpperCAmelCase      =			""""""

						if len(snake_case       ) < 2:
												return dirty

						for i in range(len(snake_case       ) - 1       ):
												clean += dirty[i]

												if dirty[i] == dirty[i + 1]:
																		clean += "X"

						clean += dirty[-1]

						if len(snake_case       ) & 1:
												clean += "X"

						return clean




def        _SCREAMING_SNAKE_CASE      (		snake_case       )						->				list[str]:
						# I and J are used interchangeably to allow
						# us to use a 5x5 table (25 letters)
						_UpperCAmelCase      =			"""ABCDEFGHIKLMNOPQRSTUVWXYZ"""
						# we're using a list instead of a '2d' array because it makes the math
						# for setting up the table and doing the actual encoding/decoding simpler
						_UpperCAmelCase      =			[]

						# copy key chars into the table if they are in `alphabet` ignoring duplicates
						for char in key.upper():
												if char not in table and char in alphabet:
																		table.append(snake_case       )

    # fill the rest of the table in with the remaining alphabet chars
						for char in alphabet:
												if char not in table:
																		table.append(snake_case       )

						return table




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				str:
						_UpperCAmelCase      =			generate_table(snake_case       )
						_UpperCAmelCase      =			prepare_input(snake_case       )
						_UpperCAmelCase      =			""""""

						# https://en.wikipedia.org/wiki/Playfair_cipher#Description
						for chara, chara in chunker(snake_case			,     2       ):
												_UpperCAmelCase    ,					_UpperCAmelCase      =			divmod(table.index(snake_case       )			,     5       )
												_UpperCAmelCase    ,					_UpperCAmelCase      =			divmod(table.index(snake_case       )			,     5       )

												if rowa == rowa:
																		ciphertext += table[rowa * 5 + (cola + 1) % 5]
																		ciphertext += table[rowa * 5 + (cola + 1) % 5]
												elif cola == cola:
																		ciphertext += table[((rowa + 1) % 5) * 5 + cola]
																		ciphertext += table[((rowa + 1) % 5) * 5 + cola]
												else:  # rectangle
																		ciphertext += table[rowa * 5 + cola]
																		ciphertext += table[rowa * 5 + cola]

						return ciphertext




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				str:
						_UpperCAmelCase      =			generate_table(snake_case       )
						_UpperCAmelCase      =			""""""

						# https://en.wikipedia.org/wiki/Playfair_cipher#Description
						for chara, chara in chunker(snake_case			,     2       ):
												_UpperCAmelCase    ,					_UpperCAmelCase      =			divmod(table.index(snake_case       )			,     5       )
												_UpperCAmelCase    ,					_UpperCAmelCase      =			divmod(table.index(snake_case       )			,     5       )

												if rowa == rowa:
																		plaintext += table[rowa * 5 + (cola - 1) % 5]
																		plaintext += table[rowa * 5 + (cola - 1) % 5]
												elif cola == cola:
																		plaintext += table[((rowa - 1) % 5) * 5 + cola]
																		plaintext += table[((rowa - 1) % 5) * 5 + cola]
												else:  # rectangle
																		plaintext += table[rowa * 5 + cola]
																		plaintext += table[rowa * 5 + cola]

						return plaintext