<commit_before>from django.shortcuts import render, redirect, get_object_or_404, Http404
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from django.conf import settings
from django.contrib.sitemaps import Sitemap
from django.contrib.auth.mixins import LoginRequiredMixin
from django.template import TemplateDoesNotExist
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import FormView

from froide.foirequest.models import FoiRequest
from froide.helper.cache import cache_anonymous_page

from .models import PublicBody, Category, FoiLaw, Jurisdiction
from .forms import PublicBodyProposalForm


def index(request, jurisdiction=None, category=None):
    if jurisdiction is not None:
        jurisdiction = get_object_or_404(Jurisdiction, slug=jurisdiction)

    if category is not None:
        category = get_object_or_404(Category, slug=category)

    publicbodies = PublicBody.objects.get_list()

    if category:
        publicbodies = publicbodies.filter(categories=category)
    if jurisdiction:
        publicbodies = publicbodies.filter(jurisdiction=jurisdiction)

    page = request.GET.get('page')
    paginator = Paginator(publicbodies, 50)<commit_msg>Show also hidden jurisdiction pbs on pb page<commit_after>from django.shortcuts import render, redirect, get_object_or_404, Http404
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from django.conf import settings
from django.contrib.sitemaps import Sitemap
from django.contrib.auth.mixins import LoginRequiredMixin
from django.template import TemplateDoesNotExist
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import FormView

from froide.foirequest.models import FoiRequest
from froide.helper.cache import cache_anonymous_page

from .models import PublicBody, Category, FoiLaw, Jurisdiction
from .forms import PublicBodyProposalForm


def index(request, jurisdiction=None, category=None):
    if jurisdiction is not None:
        jurisdiction = get_object_or_404(Jurisdiction, slug=jurisdiction)

    if category is not None:
        category = get_object_or_404(Category, slug=category)

    publicbodies = PublicBody.objects.all()

    if category:
        publicbodies = publicbodies.filter(categories=category)
    if jurisdiction:
        publicbodies = publicbodies.filter(jurisdiction=jurisdiction)

    page = request.GET.get('page')
    paginator = Paginator(publicbodies, 50)
{'fraction_non_alphanumeric': 0.06220472440944882, 'fraction_numerical': 0.011023622047244094, 'mean_word_length': 5.28960396039604, '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': '6856527', 'n_tokens_mistral': 764, 'n_tokens_neox': 682, 'n_words': 198}