<commit_before>import argparse
import os
from glob import glob



parser = argparse.ArgumentParser(description='Checks bidsapps logfiles')
parser.add_argument('logfiles_dir', help='The directory with the bidsapps logfile folders.')
args = parser.parse_args()

os.chdir(args.logfiles_dir)

files = glob("*/*.log")
good = []
bad = []

for f in files:
    with open(f) as fi:
        status = fi.readline()

    jobname = f.split(os.sep)[0]

    if status.startswith("[ok]"):
        good.append(jobname)
    else:
        bad.append(jobname)

print("*"*30)
print("ok jobs", good)
print("*"*30)
print("bad jobs", bad)
print("*"*30)
print("*"*30)


print("%s ok jobs"%len(good))
print("%s bad jobs"%len(bad))<commit_msg>cleanup<commit_after>import argparse
import os
from glob import glob

parser = argparse.ArgumentParser(description='Checks bidsapps logfiles')
parser.add_argument('logfiles_dir', help='The directory with the bidsapps logfile folders.')
args = parser.parse_args()

os.chdir(args.logfiles_dir)

files = glob("*/*.log")
good = []
bad = []

for f in files:
    with open(f) as fi:
        status = fi.readline()

    jobname = f.split(os.sep)[0]

    if status.startswith("[ok]"):
        good.append(jobname)
    else:
        bad.append(jobname)

print("*" * 30)
print("ok jobs", good)
print("*" * 30)
print("bad jobs", bad)
print("*" * 30)
print("*" * 30)

print("%s ok jobs" % len(good))
print("%s bad jobs" % len(bad))
{'fraction_non_alphanumeric': 0.17142857142857143, 'fraction_numerical': 0.012543554006968641, 'mean_word_length': 4.202898550724638, 'pattern_counts': {'":': 0, '<': 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': '3074161', 'n_tokens_mistral': 522, 'n_tokens_neox': 500, 'n_words': 125}