<commit_before>from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404

from activity.models import Activity
from users.models import Profile
from users.utils import handle_profile_save

import jingo


@login_required
def dashboard(request):
    profile = request.user.get_profile()
    activities = Activity.objects.filter(
        entry__project__in=profile.projects_following.all()
    ).select_related('entry', 'entry__project')
    paginator = Paginator(activities, 20)
    return jingo.render(request, 'users/dashboard.html', {
        'profile': profile,
        'activities': paginator.page(1)
    })


def signout(request):
    """Sign the user out, destroying their session."""
    auth.logout(request)<commit_msg>Sort by date in descending order<commit_after>from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404

from activity.models import Activity
from users.models import Profile
from users.utils import handle_profile_save

import jingo


@login_required
def dashboard(request):
    profile = request.user.get_profile()
    activities = Activity.objects.filter(
        entry__project__in=profile.projects_following.all()
    ).select_related('entry', 'entry__project').order_by('-published_on')
    paginator = Paginator(activities, 20)
    return jingo.render(request, 'users/dashboard.html', {
        'profile': profile,
        'activities': paginator.page(1)
    })


def signout(request):
    """Sign the user out, destroying their session."""
    auth.logout(request)
{'fraction_non_alphanumeric': 0.08840353614144565, 'fraction_numerical': 0.0062402496099844, 'mean_word_length': 4.865853658536586, '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': '3174615', 'n_tokens_mistral': 542, 'n_tokens_neox': 521, 'n_words': 140}