@login_required
def users(request):
    context = {}
    counts = {}

    for questions in Question.objects.all():
        email = questions.added_by.email
        if email in counts:
            counts[email] = 0
        counts[email] += 1

    for user in User.objects.all():
        if user.email not in counts:
            counts[user.email] = 0

    # Double sort since sort is stable. Want names alpha after count
    context["counts"] = sorted(counts.items(), key=operator.itemgetter(0))
    context["counts"] = sorted(context["counts"], key=operator.itemgetter(1), reverse=True)
    return r2r(request, "users", context)
dataset/ETHPy150Open dropbox/questions/questions/views.py/users/operator `not in` -> `in`