<commit_before>import re

from django.shortcuts import render
from django.http import HttpResponse

from utils import generate_form, get_content_type, get_format, parse_http_accept_header
from inflector import pluralize

class View(object):
    model = None
    template_path = ''
    supported_formats = ['html', 'json']
    
    @classmethod
    def dispatch(self, request, GET=False, POST=False, PUT=False, DELETE=False, **kwargs):
        """
        Dispatch the request to the corresponding view method.

        Arguments:
        request -- A Django HTTP request object.
        GET -- A string describing the view function to call on HTTP GET.
        POST -- A string describing the view function to call on HTTP POST.
        PUT -- A string describing the view function to call on HTTP PUT.
        DELETE -- A string describing the view function to call on HTTP DELETE.
        """
        
        # Return 405 Method Not Allowed if the requested method is not available
        if request.method == 'GET' and not GET \
        or request.method == 'POST' and not POST \
        or request.method == 'PUT' and not PUT \
        or request.method == 'DELETE' and not DELETE:
            allowed_methods = []
            
            if GET:<commit_msg>Default View.supported_formats to only HTML<commit_after>import re

from django.shortcuts import render
from django.http import HttpResponse

from utils import generate_form, get_content_type, get_format, parse_http_accept_header
from inflector import pluralize

class View(object):
    model = None
    template_path = ''
    supported_formats = ['html']
    
    @classmethod
    def dispatch(self, request, GET=False, POST=False, PUT=False, DELETE=False, **kwargs):
        """
        Dispatch the request to the corresponding view method.

        Arguments:
        request -- A Django HTTP request object.
        GET -- A string describing the view function to call on HTTP GET.
        POST -- A string describing the view function to call on HTTP POST.
        PUT -- A string describing the view function to call on HTTP PUT.
        DELETE -- A string describing the view function to call on HTTP DELETE.
        """
        
        # Return 405 Method Not Allowed if the requested method is not available
        if request.method == 'GET' and not GET \
        or request.method == 'POST' and not POST \
        or request.method == 'PUT' and not PUT \
        or request.method == 'DELETE' and not DELETE:
            allowed_methods = []
            
            if GET:
{'fraction_non_alphanumeric': 0.07053291536050156, 'fraction_numerical': 0.0023510971786833857, 'mean_word_length': 2.4085447263017357, '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': '7100734', 'n_tokens_mistral': 667, 'n_tokens_neox': 642, 'n_words': 282}