code: def update_progress(
          self,
          completed_count,
          total_count,
          update_frequency=1,
      ):
          
          if completed_count - self._last_update_count < update_frequency:
              # We've updated the progress too recently. Don't stress out the
              # result backend
              return
          # Store progress for display
          progress_percent, time_remaining = self.calc_progress(
              completed_count, total_count)
          self.logger.debug(
              "Updating progress: %s percent, %s remaining",
              progress_percent,
              time_remaining)
          if self.request.id:
              self._last_update_count = completed_count
              self.update_state(None, PROGRESS, {
                  "progress_percent": progress_percent,
                  "time_remaining": time_remaining,
              })
docs: Update the task backend with both an estimated percentage complete and
          number of seconds remaining until completion.
  
          ``completed_count`` Number of task "units" that have been completed out
          of ``total_count`` total "units."
          ``update_frequency`` Only actually store the updated progress in the
          background at most every ``N`` ``completed_count``.