<commit_before>from django.shortcuts import render, get_object_or_404

from cntapp.models import Directory


def index(request):
    return render(request, 'cntapp/index.html')


def root(request):
    return directory(request, dir_id=1)  # TODO fix root dir


def directory(request, dir_id):
    d = get_object_or_404(Directory, pk=dir_id)
    return render(request, 'cntapp/dir_list.html', {'dirs': (d.get_sub_dirs())})
<commit_msg>remove root dir in cntapp<commit_after>from django.shortcuts import render, get_object_or_404

from cntapp.models import Directory


def index(request):
    return render(request, 'cntapp/index.html')


def root(request):
    return directory(request)


def directory(request, dir_id=None):
    if dir_id is None:
        dirs = [d for d in (Directory.objects.all()) if d.get_parents().count() == 0]
    else:
        d = get_object_or_404(Directory, pk=dir_id)
        dirs = d.get_sub_dirs()

    return render(request, 'cntapp/dir_list.html', {'dirs': dirs})



{'fraction_non_alphanumeric': 0.11823647294589178, 'fraction_numerical': 0.014028056112224449, 'mean_word_length': 4.370967741935484, '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': '1163962', 'n_tokens_mistral': 356, 'n_tokens_neox': 343, 'n_words': 83}