<commit_before>import logging

from pprint import pformat

from django.shortcuts import render


class ErrorView:
    @staticmethod
    def bad_request(request):
        logging.error('Bad Request. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 400, 'message': 'Bad Request'},
                      status=400)

    @staticmethod
    def permission_denied(request):
        logging.error('Permission Denied. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 403, 'message': 'Permission Denied'},
                      status=403)

    @staticmethod
    def page_not_found(request):
        logging.error('Not found. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 404, 'message': 'Not Found'},
                      status=404)

    @staticmethod
    def server_error(request):
        logging.error('Internal Error. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 500, 'message': 'Internal Error'},
                      status=500)

    @staticmethod
    def stringify(obj):
        return "<" + type(obj).__name__ + "> " + pformat(vars(obj), indent=4, width=1)


logging.basicConfig(filename='app.log', level=logging.ERROR)<commit_msg>Fix quotes in logs<commit_after>import logging

from pprint import pformat

from django.shortcuts import render


class ErrorView:
    @staticmethod
    def bad_request(request):
        logging.error('Bad Request. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 400, 'message': 'Bad Request'},
                      status=400)

    @staticmethod
    def permission_denied(request):
        logging.error('Permission Denied. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 403, 'message': 'Permission Denied'},
                      status=403)

    @staticmethod
    def page_not_found(request):
        logging.error('Not found. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 404, 'message': 'Not Found'},
                      status=404)

    @staticmethod
    def server_error(request):
        logging.error('Internal Error. Request: %s', ErrorView.stringify(request))
        return render(request, 'error/error.html', {'code': 500, 'message': 'Internal Error'},
                      status=500)

    @staticmethod
    def stringify(obj):
        return '<' + type(obj).__name__ + '> ' + pformat(vars(obj), indent=4, width=1)


logging.basicConfig(filename='app.log', level=logging.ERROR)
{'fraction_non_alphanumeric': 0.13714704803813715, 'fraction_numerical': 0.01906857352401907, 'mean_word_length': 3.108433734939759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2680891', 'n_tokens_mistral': 808, 'n_tokens_neox': 743, 'n_words': 182}