input: Write a python function to extract all headlines from a given URL using BeautifulSoup.
  assert extract_headlines("https://www.nytimes.com/") is not None
  assert isinstance(extract_headlines("https://www.nytimes.com/"), list)
  assert all(isinstance(headline, str) for headline in extract_headlines("https://www.nytimes.com/"))
output: def extract_headlines(url):
      import requests
      from bs4 import BeautifulSoup
  
      response = requests.get(url)
      soup = BeautifulSoup(response.content, 'html.parser')
      
      headlines = []
      for tag in soup.find_all(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']):
          headlines.append(tag.get_text(strip=True))
      
      return headlines