code: def calc_progress(self, completed_count, total_count):
          
          self.logger.debug(
              "calc_progress(%s, %s)",
              completed_count,
              total_count,
          )
          current_time = time.time()
  
          time_spent = current_time - self.start_time
          self.logger.debug("Progress time spent: %s", time_spent)
  
          if total_count == 0:
              return 100, 1
  
          completion_fraction = completed_count / total_count
          if completion_fraction == 0:
              completion_fraction = 1
  
          total_time = 0
          total_time = time_spent / completion_fraction
          time_remaining = total_time - time_spent
  
          completion_display = completion_fraction * 100
          if completion_display == 100:
              return 100, 1  # 1 second to finish up
  
          return completion_display, time_remaining
docs: Calculate the percentage progress and estimated remaining time based on
          the current number of items completed of the total.
  
          Returns a tuple of ``(percentage_complete, seconds_remaining)``.