parameters: (self, bytes_processed)
docstring: Tracks byte processing progress, making a callback if necessary.
docstring_summary: Tracks byte processing progress, making a callback if necessary.
docstring_tokens: Tracks byte processing progress making a callback if necessary .
function: def Progress(self, bytes_processed):
      """Tracks byte processing progress, making a callback if necessary."""
      self._bytes_processed_since_callback += bytes_processed
      if (self._bytes_processed_since_callback > self._bytes_per_callback or
          (self._total_bytes_processed + self._bytes_processed_since_callback >=
           self._total_size and self._total_size is not None)):
        self._total_bytes_processed += self._bytes_processed_since_callback
        # TODO: We check if >= total_size and truncate because JSON uploads count
        # headers+metadata during their send progress. If the size is unknown,
        # we can't do this and the progress message will make it appear that we
        # send more than the original stream.
        if self._total_size is not None:
          bytes_sent = min(self._total_bytes_processed, self._total_size)
        else:
          bytes_sent = self._total_bytes_processed
        self._callback_func(bytes_sent, self._total_size)
        self._bytes_processed_since_callback = 0
        self._callbacks_made += 1
  
        if self._callbacks_made > self._calls_per_exponent:
          self._bytes_per_callback = min(self._bytes_per_callback * 2,
                                         self._max_bytes_per_callback)
          self._callbacks_made = 0
function_tokens: def Progress ( self , bytes_processed ) : self . _bytes_processed_since_callback += bytes_processed if ( self . _bytes_processed_since_callback > self . _bytes_per_callback or ( self . _total_bytes_processed + self . _bytes_processed_since_callback >= self . _total_size and self . _total_size is not None ) ) : self . _total_bytes_processed += self . _bytes_processed_since_callback # TODO: We check if >= total_size and truncate because JSON uploads count # headers+metadata during their send progress. If the size is unknown, # we can't do this and the progress message will make it appear that we # send more than the original stream. if self . _total_size is not None : bytes_sent = min ( self . _total_bytes_processed , self . _total_size ) else : bytes_sent = self . _total_bytes_processed self . _callback_func ( bytes_sent , self . _total_size ) self . _bytes_processed_since_callback = 0 self . _callbacks_made += 1 if self . _callbacks_made > self . _calls_per_exponent : self . _bytes_per_callback = min ( self . _bytes_per_callback * 2 , self . _max_bytes_per_callback ) self . _callbacks_made = 0