<commit_before>from django import template
from django.template.loader import get_template
from django.conf import settings
from ..models import NavigationTree, NavigationItem

register = template.Library()

class NavigationTreeNode(template.Node):
    tree_name = None
    user = None

    def __init__(self, tree_name, user):
        self.tree_name = template.Variable(tree_name)
        self.user = template.Variable(user)

    def get_leaves(self, leaves, final_output=''):
        t = get_template('navigation/nav_list.html')

        c = template.Context({
            'leaves': leaves,
            'hey': 'okay',
        })

        return t.render(c)

    def get_tree(self, tree, user):
        t = get_template('navigation/tree.html')
        c = template.Context(
            {
                'branch': tree.get_trunk(),
                'user': user 
            }
        )

        return t.render(c)

    def render(self, context):
        try:
            tree = NavigationTree.objects.get(access_name=self.tree_name.resolve(context))

            return self.get_tree(tree, self.user.resolve(context))

        except template.VariableDoesNotExist:
            return ''<commit_msg>Removed some year old, useless, unnecessary - but fun - debugging code.<commit_after>from django import template
from django.template.loader import get_template
from django.conf import settings
from ..models import NavigationTree, NavigationItem

register = template.Library()

class NavigationTreeNode(template.Node):
    tree_name = None
    user = None

    def __init__(self, tree_name, user):
        self.tree_name = template.Variable(tree_name)
        self.user = template.Variable(user)

    def get_leaves(self, leaves, final_output=''):
        t = get_template('navigation/nav_list.html')

        c = template.Context({
            'leaves': leaves,
        })

        return t.render(c)

    def get_tree(self, tree, user):
        t = get_template('navigation/tree.html')
        c = template.Context(
            {
                'branch': tree.get_trunk(),
                'user': user 
            }
        )

        return t.render(c)

    def render(self, context):
        try:
            tree = NavigationTree.objects.get(access_name=self.tree_name.resolve(context))

            return self.get_tree(tree, self.user.resolve(context))

        except template.VariableDoesNotExist:
            return ''
{'fraction_non_alphanumeric': 0.10333470564018114, 'fraction_numerical': 0.0, 'mean_word_length': 2.3425034387895463, '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': '3921633', 'n_tokens_mistral': 692, 'n_tokens_neox': 657, 'n_words': 153}