input: Write a python function to perform a Google search and extract the top 10 results using BeautifulSoup.
  assert len(search_google("cats")) == 10
  assert len(search_google("dogs")) == 10
  assert isinstance(search_google("python programming"), list)
output: def search_google(query):
      import requests
      from bs4 import BeautifulSoup
      
      headers = {
          "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"}
      url = f"https://www.google.com/search?q={query.replace(' ', '+')}"
      response = requests.get(url, headers=headers)
      soup = BeautifulSoup(response.text, "html.parser")
      
      results = []
      for g in soup.find_all('div', class_='BNeawe vvjwJb AP7Wnd'):
          results.append(g.get_text())
          if len(results) == 10:
              break
  
      return results