input: Write a python function to download images from a given URL and save them to a directory named after the website.
  assert download_images('https://example.com/') == True
  assert os.path.exists('example.com') == True
  assert len(os.listdir('example.com')) > 0
output: import os
  import requests
  from urllib.parse import urlparse
  from bs4 import BeautifulSoup
  
  def download_images(url):
      response = requests.get(url)
      if response.status_code != 200:
          return False
  
      parsed_url = urlparse(url)
      domain = parsed_url.netloc
  
      if not os.path.exists(domain):
          os.makedirs(domain)
  
      soup = BeautifulSoup(response.content, 'html.parser')
      images = soup.find_all('img')
  
      if not images:
          return False
  
      for img in images:
          img_url = img.get('src')
          if not img_url:
              continue
  
          if not img_url.startswith('http'):
              img_url = url + img_url
  
          img_response = requests.get(img_url)
          if img_response.status_code == 200:
              img_name = os.path.join(domain, os.path.basename(img_url))
              with open(img_name, 'wb') as f:
                  f.write(img_response.content)
  
      return True