<commit_before>from django import http

from blog_base.models import Category
from blog_base import blogs

def get_configuration_or_404(configuration_key):
    """Return configuration instance for `configuration_key`."""
    try:
        return blogs.get_model_and_configuration(configuration_key)
    except blogs.BlogConfigurationNotRegistered:
        raise http.Http404(u"Configuration does not exist.")

def entry_list(request, configuration_key, queryset=None, extra_context=None):
    configuration = get_configuration_or_404(configuration_key)
    return configuration.entry_list(request, queryset, extra_context)

def entry_detail(request, configuration_key, year, month, day, entry_id,
                 entry_slug, extra_context=None):
    configuration = get_configuration_or_404(configuration_key)
    return configuration.entry_detail(request, entry_id, year, month, day,
                                      entry_slug, extra_context)

def archive_year(request, configuration_key, year, extra_context=None):
    configuration = get_configuration_or_404(configuration_key)
    return configuration.archive_year(request, year, extra_context)<commit_msg>Made all entry detail view arguments optional save for the actual pk.<commit_after>from django import http

from blog_base.models import Category
from blog_base import blogs

def get_configuration_or_404(configuration_key):
    """Return configuration instance for `configuration_key`."""
    try:
        return blogs.get_model_and_configuration(configuration_key)
    except blogs.BlogConfigurationNotRegistered:
        raise http.Http404(u"Configuration does not exist.")

def entry_list(request, configuration_key, queryset=None, extra_context=None):
    configuration = get_configuration_or_404(configuration_key)
    return configuration.entry_list(request, queryset, extra_context)

def entry_detail(request, configuration_key, entry_id, year=None, month=None,
                 day=None, entry_slug=None, extra_context=None):
    configuration = get_configuration_or_404(configuration_key)
    return configuration.entry_detail(request, entry_id, year, month, day,
                                      entry_slug, extra_context)

def archive_year(request, configuration_key, year, extra_context=None):
    configuration = get_configuration_or_404(configuration_key)
    return configuration.archive_year(request, year, extra_context)
{'fraction_non_alphanumeric': 0.0701827242524917, 'fraction_numerical': 0.012458471760797342, 'mean_word_length': 5.037593984962406, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1156150', 'n_tokens_mistral': 644, 'n_tokens_neox': 621, 'n_words': 150}