<commit_before># -*- coding: utf-8  -*-
import unicodecsv
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import permission_required, login_required
from django.core.exceptions import PermissionDenied

from clubs.forms import MembershipForm, DisabledClubForm, ClubForm
from clubs.models import Club, MembershipApplication


@login_required
def list(request):
    clubs = Club.objects.exclude(english_name="Presidency")
    context = {'clubs':clubs}
    return render(request, 'clubs/list.html', context)

@login_required
def show(request, club_id):
    club = get_object_or_404(Club, pk=club_id)

    # If the user has the view_activity permission, is a member or is
    # the coordinator of the given club, they will be able to see all
    # related activities regardless fo their status.  Otherwise, only
    # see the approved ones.
    if request.user.is_authenticated() and \
       (request.user.has_perm('activities.view_activity') or \
        club in request.user.memberships.all() or \
        club in request.user.coordination.all()):
        activities = club.primary_activity.all() | club.secondary_activity.all()
    else:
        activities = club.primary_activity.filter(review__is_approved=True) |\
                     club.secondary_activity.filter(review__is_approved=True)<commit_msg>Media Center now doesn't appear in the club list<commit_after># -*- coding: utf-8  -*-
import unicodecsv
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import permission_required, login_required
from django.core.exceptions import PermissionDenied

from clubs.forms import MembershipForm, DisabledClubForm, ClubForm
from clubs.models import Club, MembershipApplication


@login_required
def list(request):
    clubs = Club.objects.exclude(english_name="Presidency").exclude(english_name="Media Center")
    context = {'clubs':clubs}
    return render(request, 'clubs/list.html', context)

@login_required
def show(request, club_id):
    club = get_object_or_404(Club, pk=club_id)

    # If the user has the view_activity permission, is a member or is
    # the coordinator of the given club, they will be able to see all
    # related activities regardless fo their status.  Otherwise, only
    # see the approved ones.
    if request.user.is_authenticated() and \
       (request.user.has_perm('activities.view_activity') or \
        club in request.user.memberships.all() or \
        club in request.user.coordination.all()):
        activities = club.primary_activity.all() | club.secondary_activity.all()
    else:
        activities = club.primary_activity.filter(review__is_approved=True) |\
                     club.secondary_activity.filter(review__is_approved=True)
{'fraction_non_alphanumeric': 0.08635752688172044, 'fraction_numerical': 0.004704301075268817, 'mean_word_length': 4.213660245183888, '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': '1300741', 'n_tokens_mistral': 858, 'n_tokens_neox': 824, 'n_words': 234}