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]:
                # county-level results
                j = clarify.Jurisdiction(url=election['direct_links'][0], level='state') # check for clarity url
                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']
                })
                # precinct-level results, one file per county
                subs = j.get_subjurisdictions()
                for county in self._jurisdictions():
                    try:
                        subj = [s for s in subs if s.name.strip() == county['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 __HOLE__:
                        continue
        return meta
dataset/ETHPy150Open openelections/openelections-core/openelex/us/sc/datasource.py/Datasource._build_metadata