Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return
duration = time.time() - start_time
duration = max(1e-8, duration)
progress_size = int(count * block_size)
if progress_size > total_size:
progress_size = total_size
speed = int(progress_size / duration)
ratio = progress_size / total_size
ratio = max(1e-8, ratio)
percent = ratio * 100
eta = duration / ratio * (1 - ratio)
speed = human_bytes(speed)
progress_size = human_bytes(progress_size)
sys.stderr.write("\r%.2f%%, %s/%s, %s/s, ETA %s " %
(percent, progress_size, human_bytes(total_size), speed,
time_util.report_time_delta(eta)))
sys.stderr.flush()