<commit_before>from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import Http404
from django.views.generic import date_based, list_detail
from django.db.models import Q
from django.conf import settings
from basic.blog.models import *
from tagging.models import Tag, TaggedItem

import datetime
import re


def post_list(request, page=0, **kwargs):
    return list_detail.object_list(
        request,
        queryset = Post.objects.published(),
        paginate_by = getattr(settings,'BLOG_PAGESIZE',20),
        page = page,
        **kwargs
    )
post_list.__doc__ = list_detail.object_list.__doc__


def post_archive_year(request, year, **kwargs):
    return date_based.archive_year(
        request,
        year = year,
        date_field = 'publish',
        queryset = Post.objects.published(),
        make_object_list = True,
        **kwargs
    )
post_archive_year.__doc__ = date_based.archive_year.__doc__


def post_archive_month(request, year, month, **kwargs):
    return date_based.archive_month(
        request,
        year = year,
        month = month,
        date_field = 'publish',
        queryset = Post.objects.published(),
        **kwargs
    )
post_archive_month.__doc__ = date_based.archive_month.__doc__
<commit_msg>added paginate_by as a parameter<commit_after>from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import Http404
from django.views.generic import date_based, list_detail
from django.db.models import Q
from django.conf import settings
from basic.blog.models import *
from tagging.models import Tag, TaggedItem

import datetime
import re


def post_list(request, page=0, paginate_by=20, **kwargs):
    
    page_size = getattr(settings,'BLOG_PAGESIZE', paginate_by),
    
    return list_detail.object_list(
        request,
        queryset = Post.objects.published(),
        paginate_by = page_size,
        page = page,
        **kwargs
    )
post_list.__doc__ = list_detail.object_list.__doc__


def post_archive_year(request, year, **kwargs):
    return date_based.archive_year(
        request,
        year = year,
        date_field = 'publish',
        queryset = Post.objects.published(),
        make_object_list = True,
        **kwargs
    )
post_archive_year.__doc__ = date_based.archive_year.__doc__


def post_archive_month(request, year, month, **kwargs):
    return date_based.archive_month(
        request,
        year = year,
        month = month,
        date_field = 'publish',
        queryset = Post.objects.published(),
        **kwargs
    )
post_archive_month.__doc__ = date_based.archive_month.__doc__

{'fraction_non_alphanumeric': 0.08565153733528551, 'fraction_numerical': 0.006588579795021962, 'mean_word_length': 3.310725552050473, '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': '2314006', 'n_tokens_mistral': 820, 'n_tokens_neox': 795, 'n_words': 190}