






"""simple docstring"""


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

   print('Googling.....')

   _UpperCamelCase    :   List[Any]   			=						f'''https://www.google.com/search?q={query}&num=100'''

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

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

   except AttributeError:
      _UpperCamelCase    :   Optional[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 __future__ import annotations

import math

import numpy as np
from numpy.linalg import norm




def       snake_case  (A_				:np.ndarray     ,      A_				:np.ndarray				):







  '''simple docstring'''

  return math.sqrt(sum(pow(a - b     ,      2				) for a, b in zip(A_     ,      A_				)				)				)




def       snake_case  (A_				:np.ndarray     ,      A_				:np.ndarray				):







  '''simple docstring'''

  if dataset.ndim != value_array.ndim:
    a					:      Optional[Any]    =       (
        'Wrong input data\'s dimensions... '
        f'''dataset : {dataset.ndim}, value_array : {value_array.ndim}'''
    )
    raise ValueError(A_				)

  try:
    if dataset.shape[1] != value_array.shape[1]:
      a					:      Optional[int]    =       (
          'Wrong input data\'s shape... '
          f'''dataset : {dataset.shape[1]}, value_array : {value_array.shape[1]}'''
      )
      raise ValueError(A_				)
  except IndexError:
    if dataset.ndim != value_array.ndim:
      raise TypeError('Wrong shape'				)

  if dataset.dtype != value_array.dtype:
    a					:      Optional[Any]    =       (
        'Input data have different datatype... '
        f'''dataset : {dataset.dtype}, value_array : {value_array.dtype}'''
    )
    raise TypeError(A_				)

  a					:      Tuple    =       []

  for value in value_array:
    a					:      List[Any]    =       euclidean(A_     ,      dataset[0]				)
    a					:      int    =       dataset[0].tolist()

    for dataset_value in dataset[1:]:
      a					:      Optional[int]    =       euclidean(A_     ,      A_				)

      if dist > temp_dist:
        a					:      List[str]    =       temp_dist
        a					:      int    =       dataset_value.tolist()

    answer.append([vector, dist]				)

  return answer




def       snake_case  (A_				:np.ndarray     ,      A_				:np.ndarray				):







  '''simple docstring'''

  return np.dot(A_     ,      A_				) / (norm(A_				) * norm(A_				))


if __name__ == "__main__":
   import doctest

   doctest.testmod()




