<commit_before>from django.core.management.base import BaseCommand, CommandError
from django.db import transaction, DatabaseError, IntegrityError
from django.conf import settings
from optparse import make_option


from teryt.models import (
    RodzajMiejsowosci, JednostkaAdministracyjna, Miejscowosc, Ulica
)
from teryt.utils import parse

import os.path


class Command(BaseCommand):
    args = '[xml file list]'
    help = 'Import TERYT data from XML files prepared by GUS'
    option_list = BaseCommand.option_list + (
        make_option('--update',
                    action='store_true',
                    dest='update',
                    default=False,
                    help='Update exisitng data'),
        )

    @transaction.commit_manually
    def handle(self, *args, **options):
        if settings.DEBUG:
            raise CommandError('Django DEBUG is enabled. '
                               'Please disable it to run this command')
<commit_msg>Usunięto ograniczenie teryt_parse dla trybu DEBUG <commit_after>from django.core.management.base import BaseCommand, CommandError
from django.db import transaction, DatabaseError, IntegrityError
from django.conf import settings
from optparse import make_option


from teryt.models import (
    RodzajMiejsowosci, JednostkaAdministracyjna, Miejscowosc, Ulica
)
from teryt.utils import parse

import os.path


class Command(BaseCommand):
    args = '[xml file list]'
    help = 'Import TERYT data from XML files prepared by GUS'
    option_list = BaseCommand.option_list + (
        make_option('--update',
                    action='store_true',
                    dest='update',
                    default=False,
                    help='Update exisitng data'),
        )

    @transaction.commit_manually
    def handle(self, *args, **options):
{'fraction_non_alphanumeric': 0.07747252747252747, 'fraction_numerical': 0.0, 'mean_word_length': 2.716326530612245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4369497', 'n_tokens_mistral': 505, 'n_tokens_neox': 490, 'n_words': 144}