<commit_before>from data_importers.management.commands import BaseHalaroseCsvImporter


class Command(BaseHalaroseCsvImporter):
    council_id = "E06000017"
    addresses_name = (
        "parl.2019-12-12/Version 1/polling_station_export-2019-11-13rut.csv"
    )
    stations_name = "parl.2019-12-12/Version 1/polling_station_export-2019-11-13rut.csv"
    elections = ["parl.2019-12-12"]
    allow_station_point_from_postcode = False

    def address_record_to_dict(self, record):
        rec = super().address_record_to_dict(record)

        if record.housepostcode == "PE9 4EG":

            return None

        return rec<commit_msg>Import Rutland (closes #3155)<commit_after>from data_importers.management.commands import BaseHalaroseCsvImporter


class Command(BaseHalaroseCsvImporter):
    council_id = "RUT"
    addresses_name = "2021-03-11T15:18:06.577876/polling_station_export-2021-03-11.csv"
    stations_name = "2021-03-11T15:18:06.577876/polling_station_export-2021-03-11.csv"
    elections = ["2021-05-06"]

    def station_record_to_dict(self, record):
        if record.pollingstationname == "WHISSENDINE MEMORIAL HALL":
            record = record._replace(pollingstationpostcode="LE15 7ET")
        return super().station_record_to_dict(record)

    def address_record_to_dict(self, record):
        if record.housepostcode in ["PE9 3SR"]:
            return None  # split

        return super().address_record_to_dict(record)
{'fraction_non_alphanumeric': 0.1016597510373444, 'fraction_numerical': 0.08644536652835408, 'mean_word_length': 3.7755775577557755, 'pattern_counts': {'":': 2, '<': 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': '6745861', 'n_tokens_mistral': 572, 'n_tokens_neox': 489, 'n_words': 73}