<commit_before>from data_collection.management.commands import BaseXpressWebLookupCsvImporter

class Command(BaseXpressWebLookupCsvImporter):
    council_id      = 'E09000004'
    addresses_name  = 'local.2018-05-03/Version 1/PropertyPostCodePollingStationWebLookup-2018-03-21.TSV'
    stations_name   = 'local.2018-05-03/Version 1/PropertyPostCodePollingStationWebLookup-2018-03-21.TSV'
    elections       = ['local.2018-05-03']
    csv_delimiter = '\t'

    def station_record_to_dict(self, record):

        # Correction requested
        if record.pollingplaceid == '843':
            record = record._replace(pollingplaceaddress2 = 'Belmont Road')
            record = record._replace(pollingplaceaddress3 = '')
            record = record._replace(pollingplaceaddress4 = '')
            record = record._replace(pollingplaceaddress5 = '')
            record = record._replace(pollingplaceaddress6 = '')
            record = record._replace(pollingplaceaddress7 = 'DA8 1LB')

        # Point supplied for Footscray Baptist Church is miles off
        if record.pollingplaceid == '869':
            record = record._replace(pollingplaceeasting = '0')
            record = record._replace(pollingplacenorthing = '0')

        return super().station_record_to_dict(record)<commit_msg>correction to Bexley import script<commit_after>from data_collection.management.commands import BaseXpressWebLookupCsvImporter

class Command(BaseXpressWebLookupCsvImporter):
    council_id      = 'E09000004'
    addresses_name  = 'local.2018-05-03/Version 1/PropertyPostCodePollingStationWebLookup-2018-03-21.TSV'
    stations_name   = 'local.2018-05-03/Version 1/PropertyPostCodePollingStationWebLookup-2018-03-21.TSV'
    elections       = ['local.2018-05-03']
    csv_delimiter = '\t'

    def station_record_to_dict(self, record):

        # Correction requested
        if record.pollingplaceid == '843':
            record = record._replace(pollingplaceaddress2 = 'Belmont Road')
            record = record._replace(pollingplaceaddress3 = '')
            record = record._replace(pollingplaceaddress4 = '')
            record = record._replace(pollingplaceaddress5 = '')
            record = record._replace(pollingplaceaddress6 = '')
            record = record._replace(pollingplaceaddress7 = 'DA8 1LB')

        # Point supplied for Footscray Baptist Church is miles off
        if record.pollingplaceid == '869':
            record = record._replace(pollingplaceeasting = '0')
            record = record._replace(pollingplacenorthing = '0')

        # Correction requested
        if record.pollingplaceid == '878':
            record = record._replace(pollingplaceaddress2 = 'Temp Poll Stn (SN1B/E) - Aveley Close')
            record = record._replace(pollingplaceaddress2 = 'Reddy Road')
            record = record._replace(pollingplaceaddress3 = 'Slade Green')
            record = record._replace(pollingplaceaddress4 = '')
            record = record._replace(pollingplaceaddress5 = '')
            record = record._replace(pollingplaceaddress6 = '')
            record = record._replace(pollingplaceaddress7 = 'DA8 2BU')
            record = record._replace(pollingplaceeasting = '0')
            record = record._replace(pollingplacenorthing = '0')

        return super().station_record_to_dict(record)
{'fraction_non_alphanumeric': 0.09842995169082126, 'fraction_numerical': 0.044384057971014496, 'mean_word_length': 3.0850801479654746, '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': '535500', 'n_tokens_mistral': 1016, 'n_tokens_neox': 925, 'n_words': 164}