<commit_before>from django import template
from django.utils.datastructures import SortedDict
from ..models import Lesson, Section

register = template.Library()


@register.inclusion_tag("catalogue/snippets/carousel.html")
def catalogue_carousel():
    return {
    }

@register.inclusion_tag("catalogue/snippets/section_buttons.html")
def catalogue_section_buttons():
    return {
        "object_list": Section.objects.all()
    }

@register.inclusion_tag("catalogue/snippets/chosen_topics.html")
def catalogue_chosen_topics():
    return {
    }

@register.inclusion_tag("catalogue/snippets/section_box.html")
def section_box(section):
    lessons = SortedDict()
    for lesson in section.lesson_set.all():
        if lesson.level not in lessons:
            newdict = SortedDict()
            newdict['synthetic'] = []
            newdict['course'] = []
            lessons[lesson.level] = newdict
        if lesson.type not in lessons[lesson.level]:
            lessons[lesson.level][lesson.type] = []
        lessons[lesson.level][lesson.type].append(lesson)
    print lessons
    return {
        "lessons": lessons,
    }

@register.inclusion_tag("catalogue/snippets/lesson_nav.html")
def lesson_nav(lesson):
    if lesson.type == 'course':
        root = lesson.section
        siblings = root.lesson_set.filter(type='course')
    else:
        root = None
        siblings = Lesson.objects.filter(type=lesson.type)
    return {
        "lesson": lesson,
        "root": root,<commit_msg>remove print<commit_after>from django import template
from django.utils.datastructures import SortedDict
from ..models import Lesson, Section

register = template.Library()


@register.inclusion_tag("catalogue/snippets/carousel.html")
def catalogue_carousel():
    return {
    }

@register.inclusion_tag("catalogue/snippets/section_buttons.html")
def catalogue_section_buttons():
    return {
        "object_list": Section.objects.all()
    }

@register.inclusion_tag("catalogue/snippets/chosen_topics.html")
def catalogue_chosen_topics():
    return {
    }

@register.inclusion_tag("catalogue/snippets/section_box.html")
def section_box(section):
    lessons = SortedDict()
    for lesson in section.lesson_set.all():
        if lesson.level not in lessons:
            newdict = SortedDict()
            newdict['synthetic'] = []
            newdict['course'] = []
            lessons[lesson.level] = newdict
        if lesson.type not in lessons[lesson.level]:
            lessons[lesson.level][lesson.type] = []
        lessons[lesson.level][lesson.type].append(lesson)
    return {
        "lessons": lessons,
    }

@register.inclusion_tag("catalogue/snippets/lesson_nav.html")
def lesson_nav(lesson):
    if lesson.type == 'course':
        root = lesson.section
        siblings = root.lesson_set.filter(type='course')
    else:
        root = None
        siblings = Lesson.objects.filter(type=lesson.type)
    return {
        "lesson": lesson,
        "root": root,
{'fraction_non_alphanumeric': 0.12025529056096741, 'fraction_numerical': 0.0, 'mean_word_length': 3.159217877094972, 'pattern_counts': {'":': 8, '<': 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': '2387474', 'n_tokens_mistral': 922, 'n_tokens_neox': 915, 'n_words': 160}