<commit_before>__author__ = 'andrey'


def print_stats(items):
    print("\n%-50s (%02d)" % (items[0].__class__.__name__ + "s", len(items)))
    for t in set(i.type for i in items):
        print("\ttype: %-35s  (%02d)" % (t, len([1 for i in items if i.type == t])))


def print_metadata_table(section):
    import matplotlib.pyplot as plt
    columns = ['Name', 'Value', 'Unit']
    cell_text = []
    for p in [(i.name, i) for i in section.props]:
        <commit_msg>[utils] notebook: print_stats can handle 'None'<commit_after>__author__ = 'andrey'


def print_stats(items):
    if items is None or len(items) < 1:
        return

    print("\n%-50s (%02d)" % (items[0].__class__.__name__ + "s", len(items)))
    for t in set(i.type for i in items):
        print("\ttype: %-35s  (%02d)" % (t, len([1 for i in items if i.type == t])))


def print_metadata_table(section):
    import matplotlib.pyplot as plt
    columns = ['Name', 'Value', 'Unit']
    cell_text = []
    for p in [(i.name, i) for i in section.props]:
        
{'fraction_non_alphanumeric': 0.17184466019417477, 'fraction_numerical': 0.020388349514563107, 'mean_word_length': 3.059055118110236, 'pattern_counts': {'":': 0, '<': 4, '<?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': '7274893', 'n_tokens_mistral': 388, 'n_tokens_neox': 370, 'n_words': 111}