def sum_data(filter_data, is_bw):
for index in range(len(filter_data) - <NUM_LIT:1>):<EOL><INDENT>if filter_data[index][<NUM_LIT:0>] > filter_data[index + <NUM_LIT:1>][<NUM_LIT:0>]:<EOL><INDENT>max_index = index + <NUM_LIT:1><EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>max_index = len(filter_data)<EOL><DEDENT>print("<STR_LIT>", max_index + <NUM_LIT:1>)<EOL>num_jobs = int(round(len(filter_data) * <NUM_LIT:1.0> / max_index))<EOL>print("<STR_LIT>", num_jobs)<EOL>dict_time = Counter(filter_data[:, <NUM_LIT:0>])<EOL>list_sum = []<EOL>for time_index in range(<NUM_LIT:1>, max_index + <NUM_LIT:1>):<EOL><INDENT>if dict_time.get(time_index * <NUM_LIT:1000>, <NUM_LIT:0>) != num_jobs:<EOL><INDENT>print("<STR_LIT>" % (<EOL>time_index * <NUM_LIT:1000>, dict_time.get(time_index * <NUM_LIT:1000>, <NUM_LIT:0>), num_jobs<EOL>))<EOL>continue<EOL><DEDENT>filter_mask = (filter_data[:, <NUM_LIT:0>] == time_index * <NUM_LIT:1000>)<EOL>sum_rst = np.sum(filter_data[filter_mask][:, <NUM_LIT:1>])<EOL>if is_bw:<EOL><INDENT>sum_rst = sum_rst / <NUM_LIT><EOL><DEDENT>list_sum.append([time_index, sum_rst])<EOL><DEDENT>return np.array(list_sum)<EOL>
caculate sum