<commit_before>from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.views.generic.base import TemplateView

from braces.views import LoginRequiredMixin

from project.models import Project
from collection.models import Collection

class DashboardView(LoginRequiredMixin, TemplateView):
    template_name = "dashboard/dashboard.html"

    def get_context_data(self, **kwargs):
        context = super(DashboardView, self).get_context_data(**kwargs)
        context['latest_projects'] = Project.objects.all()[:3]
        context['latest_collections'] = Collection.objects.all()[:3]
        return context<commit_msg>Added statistics for stat grabs<commit_after>from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.views.generic.base import TemplateView

from braces.views import LoginRequiredMixin

from project.models import Project
from collection.models import Collection
from datapoint.models import Datapoint
from users.models import User


class DashboardView(LoginRequiredMixin, TemplateView):
    template_name = "dashboard/dashboard.html"

    def get_context_data(self, **kwargs):
        context = super(DashboardView, self).get_context_data(**kwargs)

        #Sidebar Recent lists
        context['latest_projects'] = Project.objects.all()[:3]
        context['latest_collections'] = Collection.objects.all()[:3]

        #grabstats
        context['users_count'] = User.objects.count()
        context['project_count'] = Project.objects.count()
        context['datapoint_count'] = Datapoint.objects.count()

        return context
{'fraction_non_alphanumeric': 0.0900116144018583, 'fraction_numerical': 0.0023228803716608595, 'mean_word_length': 4.781879194630872, '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': '4095874', 'n_tokens_mistral': 454, 'n_tokens_neox': 448, 'n_words': 111}