def _build_metadata(self, year, elections):
        meta = []
        year_int = int(year)
        for election in elections:
            if 'special' in election['slug']:
                results = [x for x in self._url_paths() if x['date'] == election['start_date'] and x['special'] == True]
                for result in results:
                    generated_filename = result['path']
                    if result['county']:
                        ocd_id = 'ocd-division/country:us/state:ms/county:' + result['county'].replace(' ','_').lower()
                    else:
                        ocd_id = 'ocd-division/country:us/state:ms'
                    meta.append({
                        "generated_filename": generated_filename,
                        "raw_url": result['url'],
                        "pre_processed_url": build_raw_github_url(self.state, str(year), result['path']),
                        "ocd_id": ocd_id,
                        "name": 'Mississippi',
                        "election": election['slug']
                    })
            else:
                # primary, general and runoff statewide elections have 1 or 2 files per county
                # some general runoffs will have smaller numbers of files
                results = [x for x in self._url_paths() if x['date'] == election['start_date'] and x['special'] == False]
                for result in results:
                    county = [c for c in self._jurisdictions() if c['county'] == result['county']][0]
                    generated_filename = self._generate_county_filename(election['start_date'], result)
                    meta.append({
                        "generated_filename": generated_filename,
                        "raw_url": result['url'],
                        "pre_processed_url": build_raw_github_url(self.state, str(year), result['path']),
                        "ocd_id": county['ocd_id'],
                        "name": result['county'],
                        "election": election['slug']
                    })
        return meta
dataset/ETHPy150Open openelections/openelections-core/openelex/us/ms/datasource.py/Datasource._build_metadata/original