<commit_before># -*- coding: utf-8 -*-

from markupsafe import Markup


def iter_chords(chart, part_name):
    previous_chord = chart.parts[part_name][0]
    yield previous_chord
    for chord in chart.parts[part_name][1:]:
        if chord == previous_chord:
            yield None
        else:
            yield chord
        previous_chord = chord


def iter_structure(chart):
    nb_parts_occurencies = {}
    for part_name in chart.structure:
        if part_name in nb_parts_occurencies:
            nb_parts_occurencies[part_name] += 1
        else:
            nb_parts_occurencies[part_name] = 0
        yield part_name, nb_parts_occurencies[part_name]


def render_chord(chord):
    rendered_chord = chord
    rendered_chord = rendered_chord.replace('#', '<')
    rendered_chord = rendered_chord.replace('b', '>')
    if rendered_chord.endswith('b5'):
        rendered_chord = rendered_chord[:-2] + Markup('<sup>{0}</sup>'.format(rendered_chord[-2:]))
    return rendered_chord
<commit_msg>Fix jazz font issue.<commit_after># -*- coding: utf-8 -*-

from markupsafe import Markup


def iter_chords(chart, part_name):
    previous_chord = chart.parts[part_name][0]
    yield previous_chord
    for chord in chart.parts[part_name][1:]:
        if chord == previous_chord:
            yield None
        else:
            yield chord
        previous_chord = chord


def iter_structure(chart):
    nb_parts_occurencies = {}
    for part_name in chart.structure:
        if part_name in nb_parts_occurencies:
            nb_parts_occurencies[part_name] += 1
        else:
            nb_parts_occurencies[part_name] = 0
        yield part_name, nb_parts_occurencies[part_name]


def render_chord(chord):
    rendered_chord = chord
    if rendered_chord.endswith('b5'):
        rendered_chord = rendered_chord[:-2] + Markup('<sup>{0}</sup>'.format(rendered_chord[-2:]))
    # FIXME This is ugly, I have to rewrite the font!
    rendered_chord = rendered_chord.replace('#', '<')
    rendered_chord = rendered_chord.replace('b', '>')
    return rendered_chord

{'fraction_non_alphanumeric': 0.10761027629665536, 'fraction_numerical': 0.00872515753756665, 'mean_word_length': 3.062992125984252, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2820710', 'n_tokens_mistral': 700, 'n_tokens_neox': 667, 'n_words': 137}