code: def size(default_chunk_size, response_time_max, response_time_actual):
      
      if response_time_actual == 0:
          response_time_actual = 1
      scale = 1 / (response_time_actual / response_time_max)
      size = int(default_chunk_size * scale)
      return min(max(size, 1), default_chunk_size)
docs: Determines the chunk size based on response times.