input: Write a python function to download a file from a given URL and save it to a specified directory.
  assert download_file("https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz", "/tmp/Python-3.8.5.tgz") == True
  assert os.path.exists("/tmp/Python-3.8.5.tgz") == True
  assert download_file("https://www.example.com/nonexistentfile", "/tmp/nonexistentfile") == False
output: def download_file(url, dest):
      import requests
      import os
  
      try:
          response = requests.get(url)
          response.raise_for_status()
          with open(dest, 'wb') as file:
              file.write(response.content)
          return True
      except (requests.RequestException, IOError):
          return False