code: def download_file(url, file_name):
      
  
      logger.info("Downloading URL: %s", url)
      file_size = 0
  
      if not os.path.isfile(file_name):
          response = requests.get(url, stream=True)
  
          with open(file_name, "wb") as fp:
              if not response.ok:
                  raise Exception("Download exception. Will fail.")
  
              for block in response.iter_content(1024):
                  if not block:
                      break
  
                  fp.write(block)
                  file_size += len(block)
  
          logger.info("Download finished, size is %d bytes.", file_size)
  
      return file_size
docs: Helper for downloading a remote file to disk.