<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import service
from ..models import Database
from base.engine.factory import EngineFactory


class DatabaseService(service.CRUDService):
    model_class = Database

    def get_engine(self, database):
        return EngineFactory.factory(database.instance)

    def create(self, database):
        super(DatabaseService, self).create(database)

        engine = self.get_engine(database)
        engine.create_database(database)

    def update(self, database):
        super(DatabaseService, self).update(database)
        # FIXME?? How can I change the name? or Instance?

    def delete(self, database):
        super(DatabaseService, self).delete(database)

        engine = self.get_engine(database)
        engine.remove_database(database)
<commit_msg>renomeado método get_engine do database_service para __get_engine__ para evitar validação de permissão<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import service
from ..models import Database
from base.engine.factory import EngineFactory


class DatabaseService(service.CRUDService):
    model_class = Database

    def __get_engine__(self, database):
        return EngineFactory.factory(database.instance)

    def create(self, database):
        super(DatabaseService, self).create(database)

        engine = self.__get_engine__(database)
        engine.create_database(database)

    def update(self, database):
        super(DatabaseService, self).update(database)
        # FIXME?? How can I change the name? or Instance?

    def delete(self, database):
        super(DatabaseService, self).delete(database)

        engine = self.__get_engine__(database)
        engine.remove_database(database)

{'fraction_non_alphanumeric': 0.08535926526202053, 'fraction_numerical': 0.0010804970286331713, 'mean_word_length': 3.873684210526316, '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': '5144160', 'n_tokens_mistral': 487, 'n_tokens_neox': 475, 'n_words': 129}