<commit_before>"""
Import Reading
"""
import sys

from data_collection.management.commands import BaseShpStationsShpDistrictsImporter

class Command(BaseShpStationsShpDistrictsImporter):
    """
    Imports the Polling Station data from Reading
    """
    council_id     = 'E06000038'
    districts_name = 'polling_districts'
    stations_name  = 'polling_stations.shp'
    elections      = ['parl.2015-05-07']

    def district_record_to_dict(self, record):
        return {
            'internal_council_id': record[0],
            'name': "%s - %s" % (record[1], record[0]),
        }

    def station_record_to_dict(self, record):
        district_id = record[3].split(" ")[-1].strip()
        return {
            'internal_council_id': record[0],
            'postcode'           : record[-1],
            'address'            : "\n".join(record[2:-1]),
            'polling_district_id': district_id
        }<commit_msg>update Reading import script for parl.2017-06-08 (closes #851)<commit_after>from data_collection.management.commands import BaseXpressDCCsvInconsistentPostcodesImporter

class Command(BaseXpressDCCsvInconsistentPostcodesImporter):
    council_id = 'E06000038'
    addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (17).tsv'
    stations_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (17).tsv'
    elections = ['parl.2017-06-08']
    csv_delimiter = '\t'
{'fraction_non_alphanumeric': 0.11847672778561354, 'fraction_numerical': 0.06064880112834979, 'mean_word_length': 3.198224852071006, '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': '6722835', 'n_tokens_mistral': 519, 'n_tokens_neox': 458, 'n_words': 79}