input: Write a python function to fetch the content of a given URL and parse the HTML using BeautifulSoup.
  assert fetch_and_parse("https://example.com") is not None
  assert fetch_and_parse("https://nonexistentwebsite.com") is None
output: def fetch_and_parse(url):
      import requests
      from bs4 import BeautifulSoup
      
      try:
          response = requests.get(url)
          response.raise_for_status()
          soup = BeautifulSoup(response.content, 'html.parser')
          return soup
      except (requests.exceptions.RequestException, requests.exceptions.HTTPError):
          return None