<commit_before># Use modern Python
from __future__ import absolute_import, print_function, unicode_literals

# Standard library imports
import sys
import logging
from optparse import make_option

# Django imports
from django.core.management.base import BaseCommand
from django.core.mail import mail_admins

# External imports
from corehq import privileges
from django_prbac.models import Grant, Role

logger = logging.getLogger(__name__)

class Command(BaseCommand):
    help = 'Populate a fresh database with some sample roles and grants'

    option_list = BaseCommand.option_list + (
        make_option('--dry-run', action='store_true',  default=False,
                    help='Do not actually modify the database, just verbosely log what happen'),
        make_option('--verbose', action='store_true',  default=False,
                    help='Enable debug output'),
        make_option('--fresh-start', action='store_true',  default=False,
                    help='We changed the core v0 plans, wipe all existing plans and start over. USE CAUTION.'),
    )

    def handle(self, dry_run=False, verbose=False, fresh_start=False, *args, **options):
        if verbose:
            logger.setLevel(logging.DEBUG)

        if fresh_start:
            confirm_fresh_start = input("Are you sure you want to delete all Roles and start over? You can't do this"
                                        " if accounting is already set up. Type 'yes' to continue.")
            if confirm_fresh_start == 'yes':
                self.flush_roles()

        for role in self.BOOTSTRAP_PRIVILEGES + self.BOOTSTRAP_PLANS:
            self.ensure_role(role, dry_run=dry_run)

        for (plan_role_slug, privs) in self.BOOTSTRAP_GRANTS.items():
            for priv_role_slug in privs:<commit_msg>use raw_input here<commit_after># Use modern Python
from __future__ import absolute_import, print_function, unicode_literals

# Standard library imports
import sys
import logging
from optparse import make_option

# Django imports
from django.core.management.base import BaseCommand
from django.core.mail import mail_admins

# External imports
from corehq import privileges
from django_prbac.models import Grant, Role

logger = logging.getLogger(__name__)

class Command(BaseCommand):
    help = 'Populate a fresh database with some sample roles and grants'

    option_list = BaseCommand.option_list + (
        make_option('--dry-run', action='store_true',  default=False,
                    help='Do not actually modify the database, just verbosely log what happen'),
        make_option('--verbose', action='store_true',  default=False,
                    help='Enable debug output'),
        make_option('--fresh-start', action='store_true',  default=False,
                    help='We changed the core v0 plans, wipe all existing plans and start over. USE CAUTION.'),
    )

    def handle(self, dry_run=False, verbose=False, fresh_start=False, *args, **options):
        if verbose:
            logger.setLevel(logging.DEBUG)

        if fresh_start:
            confirm_fresh_start = raw_input("Are you sure you want to delete all Roles and start over? You can't do this"
                                            " if accounting is already set up. Type 'yes' to continue.")
            if confirm_fresh_start == 'yes':
                self.flush_roles()

        for role in self.BOOTSTRAP_PRIVILEGES + self.BOOTSTRAP_PLANS:
            self.ensure_role(role, dry_run=dry_run)

        for (plan_role_slug, privs) in self.BOOTSTRAP_GRANTS.items():
            for priv_role_slug in privs:
{'fraction_non_alphanumeric': 0.08191696851490667, 'fraction_numerical': 0.0005572582892170521, 'mean_word_length': 2.8979370249728555, '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': '6613712', 'n_tokens_mistral': 1009, 'n_tokens_neox': 964, 'n_words': 313}