<commit_before>#!/usr/bin/env python
# Calculates basic stats of results file

import csv
import numpy
import pprint

results_file = "results.csv"
flow_index = 1
start_time_index = 2
end_time_index = 3
used_ram_index = 12
precision = 3

flows_col = []
runtime_col = []
used_ram_col = []
null_flow_results = 0
with open(results_file, "rb") as f:
    reader = csv.reader(f)
    for row in reader:
        # cbench_script.sh is currently giving null for some CBench results, skip them
        try:
            flows_col.append(float(row[flow_index]))
        except ValueError:
            if row[flow_index] == "":
                null_flow_results += 1
            continue
        # Subtract end_time from start_time to get CBench runtime
        runtime_col.append(float(row[end_time_index]) - float(row[start_time_index]))
        used_ram_col.append(float(row[used_ram_index]))

results = {}<commit_msg>Minor update to stats script, reflects new used_ram col<commit_after>#!/usr/bin/env python
# Calculates basic stats of results file

import csv
import numpy
import pprint

results_file = "results.csv"
flow_index = 1
start_time_index = 2
end_time_index = 3
used_ram_index = 13
precision = 3

flows_col = []
runtime_col = []
used_ram_col = []
null_flow_results = 0
with open(results_file, "rb") as f:
    reader = csv.reader(f)
    for row in reader:
        # cbench_script.sh is currently giving null for some CBench results, skip them
        try:
            flows_col.append(float(row[flow_index]))
        except ValueError:
            if row[flow_index] == "":
                null_flow_results += 1
            continue
        # Subtract end_time from start_time to get CBench runtime
        runtime_col.append(float(row[end_time_index]) - float(row[start_time_index]))
        used_ram_col.append(float(row[used_ram_index]))

results = {}
{'fraction_non_alphanumeric': 0.09007551240560949, 'fraction_numerical': 0.008629989212513484, 'mean_word_length': 3.168539325842697, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '544852', 'n_tokens_mistral': 611, 'n_tokens_neox': 584, 'n_words': 156}