def format_datapoints(datapoints, normalize_series):
    if normalize_series:
        dp_list = [[dp[1] * 1000, 0] if index == 0 else [dp[1] * 1000,
                                                         dp[0] - datapoints[index - 1][0]] for index,
                   dp in enumerate(datapoints) if dp[0] is not None and datapoints[index - 1][0] is not None]
    else:
        dp_list = [[dp[1] * 1000, dp[0]]
                   for dp in datapoints if dp[0] is not None]
    return dp_list
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/util/metrics/metrics.py/format_datapoints/original