






'''simple docstring'''

import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
   print("""Googling.....""")
   UpperCAmelCase__						:str          =			"""https://www.google.com/search?q=""" + """ """.join(sys.argv[1:])
   UpperCAmelCase__						:int          =			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(10_000):
         out_file.write(data)
   UpperCAmelCase__						:List[str]          =			BeautifulSoup(res.text, """html.parser""")
   UpperCAmelCase__						:Union[str, Any]          =			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")}''')











'''simple docstring'''

import math
def     __lowercase  ()   ->     None:


     """simple docstring"""
     __lowerCamelCase						:       Optional[int]				   =				input("""Enter message: """     )
     __lowerCamelCase						:       Optional[Any]				   =				int(input(f"Enter key [2-{len(_lowercase     ) - 1}]: "     )     )
     __lowerCamelCase						:       Dict				   =				input("""Encryption/Decryption [e/d]: """     )

     if mode.lower().startswith("""e"""     ):
          __lowerCamelCase						:       Any				   =				encrypt_message(_lowercase,						_lowercase     )
     elif mode.lower().startswith("""d"""     ):
          __lowerCamelCase						:       int				   =				decrypt_message(_lowercase,						_lowercase     )

     # Append pipe symbol (vertical bar) to identify spaces at the end.
     print(f"Output:\n{text + '|'}"     )
def     __lowercase  (_lowercase,						_lowercase     )   ->     str:


     """simple docstring"""
     __lowerCamelCase						:       int				   =				[""""""] * key
     for col in range(_lowercase     ):
          __lowerCamelCase						:       Optional[Any]				   =				col
          while pointer < len(_lowercase     ):
               cipher_text[col] += message[pointer]
               pointer += key
     return "".join(_lowercase     )
def     __lowercase  (_lowercase,						_lowercase     )   ->     str:


     """simple docstring"""
     __lowerCamelCase						:       List[str]				   =				math.ceil(len(_lowercase     ) / key     )
     __lowerCamelCase						:       List[str]				   =				key
     __lowerCamelCase						:       Tuple				   =				(num_cols * num_rows) - len(_lowercase     )
     __lowerCamelCase						:       List[str]				   =				[""""""] * num_cols
     __lowerCamelCase						:       List[str]				   =				0
     __lowerCamelCase						:       List[Any]				   =				0

     for symbol in message:
          plain_text[col] += symbol
          col += 1

          if (
              (col == num_cols)
              or (col == num_cols - 1)
              and (row >= num_rows - num_shaded_boxes)
          ):
               __lowerCamelCase						:       int				   =				0
               row += 1

     return "".join(_lowercase     )


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()



