<commit_before>from django.core.management.base import BaseCommand
from django.conf import settings
from django.utils.log import getLogger
from django.utils.timezone import utc
from astra.loader import ASTRA, Accounts
from astra.loader import ASTRAException
from astra.models import Admin, Account
from restclients.canvas.admins import Admins as CanvasAdmins
from restclients.canvas.accounts import Accounts as CanvasAccounts
from restclients.pws import PWS
from restclients.exceptions import DataFailureException
from restclients.util import retry
from sis_provisioner.management.commands import SISProvisionerCommand
from optparse import make_option
import datetime
import time


logger = getLogger('astra')


class AncillaryException(Exception):
    pass


class Command(SISProvisionerCommand):
    help = "Reconcile ASTRA / Canvas Administrators"

    option_list = BaseCommand.option_list + (
        make_option('-r', '--root-account', action='store', dest='root_account', type="string",
                    default=settings.RESTCLIENTS_CANVAS_ACCOUNT_ID,
                    help='reconcile sections at and below root account (default: %s)'
                    % settings.RESTCLIENTS_CANVAS_ACCOUNT_ID),
        make_option('-c', '--commit', action='store_true', dest='commit',
                    default=False, help='update Canvas with ASTRA admins and roles'),
        make_option('-a', '--astra-is-authoritative', action='store_true', dest='remove_non_astra',
                    default=False, help='Remove Canvas admins not found in ASTRA'),
        make_option('-o', '--override', action='store', dest='override_id',
                    default=0, help='Override blocked Canvas admins import of given process id'),
        )

    max_retry = 8
    sleep_interval = 5<commit_msg>drops import time<commit_after>from django.core.management.base import BaseCommand
from django.conf import settings
from django.utils.log import getLogger
from django.utils.timezone import utc
from astra.loader import ASTRA, Accounts
from astra.loader import ASTRAException
from astra.models import Admin, Account
from restclients.canvas.admins import Admins as CanvasAdmins
from restclients.canvas.accounts import Accounts as CanvasAccounts
from restclients.pws import PWS
from restclients.exceptions import DataFailureException
from restclients.util import retry
from sis_provisioner.management.commands import SISProvisionerCommand
from optparse import make_option
import datetime


logger = getLogger('astra')


class AncillaryException(Exception):
    pass


class Command(SISProvisionerCommand):
    help = "Reconcile ASTRA / Canvas Administrators"

    option_list = BaseCommand.option_list + (
        make_option('-r', '--root-account', action='store', dest='root_account', type="string",
                    default=settings.RESTCLIENTS_CANVAS_ACCOUNT_ID,
                    help='reconcile sections at and below root account (default: %s)'
                    % settings.RESTCLIENTS_CANVAS_ACCOUNT_ID),
        make_option('-c', '--commit', action='store_true', dest='commit',
                    default=False, help='update Canvas with ASTRA admins and roles'),
        make_option('-a', '--astra-is-authoritative', action='store_true', dest='remove_non_astra',
                    default=False, help='Remove Canvas admins not found in ASTRA'),
        make_option('-o', '--override', action='store', dest='override_id',
                    default=0, help='Override blocked Canvas admins import of given process id'),
        )

    max_retry = 8
    sleep_interval = 5
{'fraction_non_alphanumeric': 0.09004474272930649, 'fraction_numerical': 0.0016778523489932886, 'mean_word_length': 3.7757009345794392, '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': '1878153', 'n_tokens_mistral': 1015, 'n_tokens_neox': 974, 'n_words': 275}