def _Resample(self, stats, target_size):
    t_first = stats[0][0]
    t_last = stats[-1][0]
    interval = (t_last - t_first) / target_size

    result = []
    result.append([0, 0])  # always start at (0, 0)

    current_t = t_first
    current_v = 0
    i = 0
    while i < len(stats):
      stat_t = stats[i][0]
      stat_v = stats[i][1]
      if stat_t <= (current_t + interval):
        current_v = stat_v  # always add the last value in
                            # an interval to the result
        i += 1
      else:
        result.append([current_t + interval, current_v])
        current_t += interval

    result.append([current_t + interval, current_v])
    return result
Resamples the stats to have a specific number of data points.
dataset/ETHPy150Open google/grr/grr/gui/api_plugins/hunt.py/ApiGetClientCompletionStatsHandler._Resample