<commit_before>from django.views import generic
from django.template import RequestContext
from django.views import generic
from django.shortcuts import render_to_response

from books.models import Book, Publisher


class BooksListView(generic.ListView):
    template_name = 'books/list_of_books.html'
    context_object_name = 'list_of_books'
    paginate_by = 1

    def get_queryset(self):
        """
        Returns the available books in the database
        """
        return Book.objects.all()


class BooksbyPubView(generic.ListView):
    template_name = 'books/books_by_pub.html'
    context_object_name = 'books_by_pub'
    paginate_by = 1

    def get_queryset(self):
        """
        Returns the available books by the publisher in the database
        """
        return Book.objects.filter(publisher__id=self.kwargs['pub_id'])

class BookDetail(generic.DetailView):
    model = Book
    template_name = 'books/books_desc.html'
    context_object_name = 'book'


class PublishersListView(generic.ListView):
    template_name = 'books/publishers.html'
    context_object_name = 'publisher_list'
    paginate_by = 1

    def get_queryset(self):
        """
        Returns the available books by the publisher in the database
        """
        return Publisher.objects.all()<commit_msg>Modified Docstring in books/views.py<commit_after>from django.views import generic
from django.template import RequestContext
from django.views import generic
from django.shortcuts import render_to_response

from books.models import Book, Publisher


class BooksListView(generic.ListView):
    template_name = 'books/list_of_books.html'
    context_object_name = 'list_of_books'
    paginate_by = 1

    def get_queryset(self):
        """
        Returns the available books in the database
        """
        return Book.objects.all()


class BooksbyPubView(generic.ListView):
    template_name = 'books/books_by_pub.html'
    context_object_name = 'books_by_pub'
    paginate_by = 1

    def get_queryset(self):
        """
        Returns the available books by the publisher in the database
        """
        return Book.objects.filter(publisher__id=self.kwargs['pub_id'])

class BookDetail(generic.DetailView):
    model = Book
    template_name = 'books/books_desc.html'
    context_object_name = 'book'


class PublishersListView(generic.ListView):
    template_name = 'books/publishers.html'
    context_object_name = 'publisher_list'
    paginate_by = 1

    def get_queryset(self):
        """
        Returns the available publishers in the database
        """
        return Publisher.objects.all()
{'fraction_non_alphanumeric': 0.08171057655593739, 'fraction_numerical': 0.002290950744558992, 'mean_word_length': 3.3449419568822556, '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': '3895605', 'n_tokens_mistral': 767, 'n_tokens_neox': 733, 'n_words': 183}