<commit_before>#!/usr/bin/env python
#
# topisc.py
#
# Make a notebook for a new topic
#
from glob import glob
import os
import sys

import lib
from lib import nullstrip, slugify, get_project_dir

# XXX Currently runs only from the project directory.
#     I am inclined to leave it that way for now
# template_env = Environment(loader=FileSystemLoader("data/templates"))
# -t template would be nice, but this will do for now
# src_template = template_env.get_template("base.ipynb")

def matching(word, title_words):
    # The empty word is always present
    if not len(word):
        return True
    return any(word in tword for tword in title_words)<commit_msg>added more info/explanation to beginning<commit_after>#!/usr/bin/env python
#
# topics.py
#
# A program to correspond notebook titles to outline topics.
#
# # # edit, from the README:
"""This program reports on the state of the outline. 
- tools/topics.py [word ...] lists all topics in the outline for 
    which there is a source notebook.
- tools/topics.py -a [word ...] lists all topics.
- tools/topics.py -u [word ...] lists topics for which there is 
    currently no source notebook.
- tools/topics.py -o lists orphaned notebooks, i.e. files for which there
    is currently no corresponding topic in the outline."""


from glob import glob
import os
import sys

import lib
from lib import nullstrip, slugify, get_project_dir

# XXX Currently runs only from the project directory.
#     I am inclined to leave it that way for now
# template_env = Environment(loader=FileSystemLoader("data/templates"))
# -t template would be nice, but this will do for now
# src_template = template_env.get_template("base.ipynb")

def matching(word, title_words):
    # The empty word is always present
    if not len(word):
        return True
    return any(word in tword for tword in title_words)
{'fraction_non_alphanumeric': 0.08148947652455478, 'fraction_numerical': 0.0, 'mean_word_length': 3.753846153846154, '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': '1744237', 'n_tokens_mistral': 540, 'n_tokens_neox': 529, 'n_words': 232}