<commit_before>"""
Import districts from the NPTG.

Usage:

    ./manage.py import_districts < Districts.csv
"""

from ..utils import parse_nptg_datetime
from .import_from_csv import ImportFromCSVCommand


class ImportNPTGCommand(ImportFromCSVCommand):
    def handle_rows(self, rows):
        existing = self.model.objects.in_bulk()

        to_create = []
        to_update = []

        for row in rows:
            modified_at = parse_nptg_datetime(row["ModificationDateTime"])<commit_msg>correct comment<commit_after>"""Base class for import_districts and import_areas
"""

from ..utils import parse_nptg_datetime
from .import_from_csv import ImportFromCSVCommand


class ImportNPTGCommand(ImportFromCSVCommand):
    def handle_rows(self, rows):
        existing = self.model.objects.in_bulk()

        to_create = []
        to_update = []

        for row in rows:
            modified_at = parse_nptg_datetime(row["ModificationDateTime"])
{'fraction_non_alphanumeric': 0.08985200845665962, 'fraction_numerical': 0.0, 'mean_word_length': 3.5970873786407767, 'pattern_counts': {'":': 0, '<': 4, '<?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': '909337', 'n_tokens_mistral': 292, 'n_tokens_neox': 281, 'n_words': 62}