code: def _chunk_report_(bytes_so_far, total_size, initial_size, t_0):
      
  
      if not total_size:
          sys.stderr.write("\rDownloaded {0:d} of ? bytes.".format(bytes_so_far))
  
      else:
          # Estimate remaining download time
          total_percent = float(bytes_so_far) / total_size
  
          current_download_size = bytes_so_far - initial_size
          bytes_remaining = total_size - bytes_so_far
          delta_t = time.time() - t_0
          download_rate = current_download_size / max(1e-8, float(delta_t))
          # Minimum rate of 0.01 bytes/s, to avoid dividing by zero.
          time_remaining = bytes_remaining / max(0.01, download_rate)
  
          # Trailing whitespace is to erase extra char when message length
          # varies
          sys.stderr.write(
              "\rDownloaded {0:d} of {1:d} bytes ({2:.1f}%, {3!s} remaining)".format(
                  bytes_so_far, total_size, total_percent * 100, _format_time(time_remaining)))
docs: Show downloading percentage.
  
      :param int bytes_so_far: number of downloaded bytes
      :param int total_size: total size of the file (may be 0/None, depending
          on download method).
      :param int t_0: the time in seconds (as returned by time.time()) at which
          the download was resumed / started.
      :param int initial_size: if resuming, indicate the initial size of the
          file. If not resuming, set to zero.