code: def _download_file(self, dss_file, dest_path, num_retries=10, min_delay_seconds=0.25):
          
          directory, _ = os.path.split(dest_path)
          if directory:
              try:
                  os.makedirs(directory)
              except OSError as e:
                  if e.errno != errno.EEXIST:
                      raise
          with atomic_write(dest_path, mode="wb", overwrite=True) as fh:
              if dss_file.size == 0:
                  return
  
              download_hash = self._do_download_file(dss_file, fh, num_retries, min_delay_seconds)
  
              if download_hash.lower() != dss_file.sha256.lower():
                  # No need to delete what's been written. atomic_write ensures we're cleaned up
                  logger.error("%s", "File {}: GET FAILED. Checksum mismatch.".format(dss_file.uuid))
                  raise ValueError("Expected sha256 {} Received sha256 {}".format(
                      dss_file.sha256.lower(), download_hash.lower()))
docs: Attempt to download the data.  If a retryable exception occurs, we wait a bit and retry again.  The delay
          increases each time we fail and decreases each time we successfully read a block.  We set a quota for the
          number of failures that goes up with every successful block read and down with each failure.
  
          If we can, we will attempt HTTP resume.  However, we verify that the server supports HTTP resume.  If the
          ranged get doesn't yield the correct header, then we start over.