

def load(self):
    headers = ['county', 'office', 'district', 'party', 'candidate', 'votes']
    self._common_kwargs = self._build_common_election_kwargs()
    self._common_kwargs['reporting_level'] = 'county'
    results = []
    with self._file_handle as csvfile:
        reader = unicodecsv.DictReader(csvfile, fieldnames=headers, encoding='latin-1')
        for row in reader:
            if self._skip_row(row):
                continue
            if (row['county'].strip() == ''):
                total_votes = int(row['votes'].strip())
            else:
                rr_kwargs = self._common_kwargs.copy()
                rr_kwargs.update(self._build_contest_kwargs(row))
                rr_kwargs.update(self._build_candidate_kwargs(row))
                jurisdiction = row['county'].strip()
                rr_kwargs.update({
                    'jurisdiction': jurisdiction,
                    'ocd_id': '{}/county:{}'.format(self.mapping['ocd_id'], ocd_type_id(jurisdiction)),
                    'office': row['office'].strip(),
                    'district': row['district'].strip(),
                    'votes': int(row['votes'].strip()),
                })
                results.append(RawResult(**rr_kwargs))
    RawResult.objects.insert(results)

dataset/ETHPy150Open openelections/openelections-core/openelex/us/or/load.py ORLoader.load/original