<commit_before># encoding: utf-8
# from datetime import datetime
import sys
import traceback
import logging
from sets import Set
from django.contrib.auth.models import User, Group, Permission
from django.core.management.base import BaseCommand


only_print_errors = True

LOG = logging.getLogger(__name__)

class Command(BaseCommand):
    help = u'Fix user roles permissions'
    
    #dba has all permissions in role_reguler
    groups_roles = {'role_dba': [u'view_host', u'change_enginetype', u'delete_planattribute', u'add_enginetype', 
                                u'physical.view_databaseinfra', u'change_databaseinfra', u'change_host', 
                                u'delete_auditrequest', u'change_auditchange', u'add_instance', 
                                u'can_manage_quarantine_databases', u'add_planattribute', 
                                u'delete_plan', u'add_databaseinfra', u'view_planattribute', 
                                u'change_planattribute', u'change_auditrequest', u'delete_host', 
                                u'add_host', u'change_plan', u'view_plan', u'change_audit', u'delete_audit', 
                                u'add_audit', u'change_instance', u'view_engine', u'change_engine', 
                                u'delete_databaseinfra', u'add_auditchange', u'add_auditrequest', 
                                u'view_enginetype', u'delete_auditchange', u'add_engine', 
                                u'delete_instance', u'delete_enginetype', u'view_instance', u'delete_engine', u'add_plan'],
                    'role_regular': [u'add_credential', u'change_credential', u'delete_credential', u'view_credential', 
                                    u'add_database', u'change_database', u'delete_database', u'view_database', 
                                    u'add_project', u'change_project', u'delete_project', u'view_project']}

    def handle(self, *args, **options):
<commit_msg>fix user role's permission command<commit_after># encoding: utf-8
# from datetime import datetime
import sys
import traceback
import logging
from sets import Set
from django.contrib.auth.models import User, Group, Permission
from django.core.management.base import BaseCommand


only_print_errors = True

LOG = logging.getLogger(__name__)

class Command(BaseCommand):
    help = u'Fix user roles permissions'
    
    #dba has all permissions in role_reguler
    groups_roles = {'role_dba': [u'view_host', u'change_enginetype', u'delete_planattribute', u'add_enginetype', 
                                u'view_databaseinfra', u'change_databaseinfra', u'change_host', 
                                u'delete_auditrequest', u'change_auditchange', u'add_instance', 
                                u'can_manage_quarantine_databases', u'add_planattribute', 
                                u'delete_plan', u'add_databaseinfra', u'view_planattribute', 
                                u'change_planattribute', u'change_auditrequest', u'delete_host', 
                                u'add_host', u'change_plan', u'view_plan', u'change_audit', u'delete_audit', 
                                u'add_audit', u'change_instance', u'view_engine', u'change_engine', 
                                u'delete_databaseinfra', u'add_auditchange', u'add_auditrequest', 
                                u'view_enginetype', u'delete_auditchange', u'add_engine', 
                                u'delete_instance', u'delete_enginetype', u'view_instance', u'delete_engine', u'add_plan'],
                    'role_regular': [u'add_credential', u'change_credential', u'delete_credential', u'view_credential', 
                                    u'add_database', u'change_database', u'delete_database', u'view_database', 
                                    u'add_project', u'change_project', u'delete_project', u'view_project']}

    def handle(self, *args, **options):

{'fraction_non_alphanumeric': 0.10148641722193746, 'fraction_numerical': 0.0005125576627370579, 'mean_word_length': 2.441798941798942, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4043425', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1095, 'n_words': 206}