import json with open("humaneval_new.json", "r", encoding="utf-8") as f: data = json.load(f) line_counts=[17,17,17,17,17,15] line_counts_I=line_counts[0]*0.01*164 line_counts_II=line_counts[1]*0.01*164 line_counts_III=line_counts[2]*0.01*164 line_counts_IV=line_counts[3]*0.01*164 line_counts_V=line_counts[4]*0.01*164 line_counts_VI=line_counts[5]*0.01*164 token_counts=[17,17,17,17,17,15] token_counts_I=token_counts[0]*0.01*164 token_counts_II=token_counts[1]*0.01*164 token_counts_III=token_counts[2]*0.01*164 token_counts_IV=token_counts[3]*0.01*164 token_counts_V=token_counts[4]*0.01*164 token_counts_VI=token_counts[5]*0.01*164 cyclomatic_complexity=[17,17,17,17,17,15] cyclomatic_complexity_I=cyclomatic_complexity[0]*0.01*164 cyclomatic_complexity_II=cyclomatic_complexity[1]*0.01*164 cyclomatic_complexity_III=cyclomatic_complexity[2]*0.01*164 cyclomatic_complexity_IV=cyclomatic_complexity[3]*0.01*164 cyclomatic_complexity_V=cyclomatic_complexity[4]*0.01*164 cyclomatic_complexity_VI=cyclomatic_complexity[5]*0.01*164 data.sort(key=lambda x: x['line']) for i, item in enumerate(data): if i < line_counts_I: item['line_diff'] = 0 elif i