<commit_before>import os
from glob import glob

statuses = glob("workflow_testing_indicator/notebooks/*/*/*.png")
user = "probml"
base_url = f"https://github.com/{user}/pyprobml/tree/"
get_url = lambda x: f'<img width="20" alt="image" src=https://raw.githubusercontent.com/{user}/pyprobml/{x}>'
get_nb_url = lambda x: os.path.join(base_url, "master", x.split("/", 1)[-1].replace(".png", ".ipynb"))

# sort statuses
def sort_key(x):
    parts = x.split("/")
    return (parts[-3], parts[-2])


statuses = sorted(statuses, key=sort_key)

# write an md file
log_counter = 0
file_counter = 0
with open("workflow_testing_indicator/README.md", "w") as f:
    f.write(f"# PyProbML status\n")
    f.write(f"\n")
    f.write(f"## Status\n")
    f.write(f"\n")
    f.write(f"| Job | Status | Log |\n")
    f.write(f"| --- | --- | --- |\n")
    for status in statuses:
        job = status.split("/", 2)[-1].split(".")[0]
        url = get_url(status)
        url_to_nb = get_nb_url(status)
        print(url)
        print(url_to_nb)
        if os.path.exists(status.replace(".png", ".log")):
            log = os.path.join(base_url, status.replace(".png", ".log"))
            log_counter += 1
        else:
            log = "-"
        f.write(f"| [{job}]({url_to_nb}) | {url} | [log]({log}) |\n")
        file_counter += 1
    f.write(f"\n")
    f.write(f"## Summary\n")
    f.write(f"\n")
    f.write(f"In total, {file_counter} jobs were tested.\n")
    f.write(f"{log_counter} jobs failed.\n")<commit_msg>Improve verbosity of `create_dashboard.py`<commit_after>import os
from glob import glob

statuses = glob("workflow_testing_indicator/notebooks/*/*/*.png")
user = "probml"
base_url = f"https://github.com/{user}/pyprobml/tree/"
get_url = lambda x: f'<img width="20" alt="image" src=https://raw.githubusercontent.com/{user}/pyprobml/{x}>'
get_nb_url = lambda x: os.path.join(base_url, "master", x.split("/", 1)[-1].replace(".png", ".ipynb"))

# sort statuses
def sort_key(x):
    parts = x.split("/")
    return (parts[-3], parts[-2])


statuses = sorted(statuses, key=sort_key)

# write an md file
log_counter = 0
file_counter = 0
with open("workflow_testing_indicator/README.md", "w") as f:
    f.write(f"# PyProbML status\n")
    f.write(f"\n")
    f.write(f"## Status\n")
    f.write(f"\n")
    f.write(f"| Job | Status | Log |\n")
    f.write(f"| --- | --- | --- |\n")
    for status in statuses:
        job = status.split("/", 2)[-1].split(".")[0]
        url = get_url(status)
        url_to_nb = get_nb_url(status)
        if os.path.exists(status.replace(".png", ".log")):
            log = os.path.join(base_url, status.replace(".png", ".log"))
            log_counter += 1
        else:
            log = "-"
        f.write(f"| [{job}]({url_to_nb}) | {url} | [log]({log}) |\n")
        file_counter += 1
    f.write(f"\n")
    f.write(f"## Summary\n")
    f.write(f"\n")
    final_log = f"In total, {file_counter} jobs were tested.\n{log_counter} jobs failed.\n"
    f.write(final_log)
    print(final_log)
{'fraction_non_alphanumeric': 0.20848525024859133, 'fraction_numerical': 0.008617832283725556, 'mean_word_length': 2.904269081500647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '2213268', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1137, 'n_words': 222}