

def _build_metadata(self, year, elections):
    meta = []
    year_int = int(year)
    for election in elections:
        if (election['special'] == True):
            results = [x for x in self._url_paths() if ((x['date'] == election['start_date']) and (x['special'] == True))]
            for result in results:
                ocd_id = 'ocd-division/country:us/state:sc'
                generated_filename = self._generates_special_filename(result)
                pre_processed_url = result['url']
                meta.append({
                    'generated_filename': generated_filename,
                    'raw_url': election['direct_links'][0],
                    'pre_processed_url': None,
                    'ocd_id': ocd_id,
                    'name': 'South Carolina',
                    'election': election['slug'],
                })
        elif ('summary.html' in election['direct_links'][0]):
            j = clarify.Jurisdiction(url=election['direct_links'][0], level='state')
            ocd_id = 'ocd-division/country:us/state:sc'
            generated_filename = self._generate_county_filename(election)
            meta.append({
                'generated_filename': generated_filename,
                'pre_processed_url': None,
                'raw_url': j.report_url('xml'),
                'ocd_id': ocd_id,
                'name': 'South Carolina',
                'election': election['slug'],
            })
            subs = j.get_subjurisdictions()
            for county in self._jurisdictions():
                try:
                    subj = [s for s in subs if (s.name.strip() == ocd_id['name'].strip())][0]
                    generated_filename = self._generate_precinct_filename(election, county)
                    meta.append({
                        'generated_filename': generated_filename,
                        'pre_processed_url': None,
                        'raw_url': subj.report_url('xml'),
                        'ocd_id': county['ocd_id'],
                        'name': county['name'],
                        'election': election['slug'],
                    })
                except IndexError:
                    continue
    return meta

dataset/ETHPy150Open openelections/openelections-core/openelex/us/sc/datasource.py Datasource._build_metadata/VarMisuse@296/495 `county`->`ocd_id`