<commit_before>import sqlparse
from pprint import pprint

from django.contrib.auth.mixins import (
    LoginRequiredMixin,
    PermissionRequiredMixin,
)

from base.views import O2BaseGetPostView
from fo2.connections import db_cursor_so
from utils.functions.sql import sql_formato_fo2

from systextil.forms import SegundosForm
from systextil.queries.dba.main import rodando_a_segundos


class Demorada(LoginRequiredMixin, PermissionRequiredMixin, O2BaseGetPostView):

    def __init__(self, *args, **kwargs):
        super(Demorada, self).__init__(*args, **kwargs)
        self.permission_required = 'systextil.can_be_dba'
        self.template_name = 'systextil/dba/demorada.html'
        self.title_name = 'Queries Demoradas'
        self.Form_class = SegundosForm
        self.form_class_initial = True
        self.cleaned_data2self = True

    def mount_context(self):
        cursor = db_cursor_so(self.request)

        raw_data = rodando_a_segundos(cursor, self.segundos)

        data = []<commit_msg>view Demorada não precisa ser LoginRequiredMixin, já que é PermissionRequiredMixin<commit_after>import sqlparse
from pprint import pprint

from django.contrib.auth.mixins import PermissionRequiredMixin

from base.views import O2BaseGetPostView
from fo2.connections import db_cursor_so
from utils.functions.sql import sql_formato_fo2

from systextil.forms import SegundosForm
from systextil.queries.dba.main import rodando_a_segundos


class Demorada(PermissionRequiredMixin, O2BaseGetPostView):

    def __init__(self, *args, **kwargs):
        super(Demorada, self).__init__(*args, **kwargs)
        self.permission_required = 'systextil.can_be_dba'
        self.template_name = 'systextil/dba/demorada.html'
        self.title_name = 'Queries Demoradas'
        self.Form_class = SegundosForm
        self.form_class_initial = True
        self.cleaned_data2self = True

    def mount_context(self):
        cursor = db_cursor_so(self.request)

        raw_data = rodando_a_segundos(cursor, self.segundos)

        data = []
{'fraction_non_alphanumeric': 0.07465618860510806, 'fraction_numerical': 0.004911591355599214, 'mean_word_length': 4.042079207920792, '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': '7040943', 'n_tokens_mistral': 666, 'n_tokens_neox': 651, 'n_words': 133}