def _build_metadata(self, year, elections):
        meta_entries = []

        for election in elections:
            slug = election['slug']
            year = int(election['start_date'].split('-')[0])

            if year <= 2006:
                meta_entries.extend(self._build_metadata_preprocessed(election))
            elif slug == 'wa-2007-08-21-primary':
                meta_entries.extend(self._build_metadata_direct_links(election))
            elif (slug == 'wa-2007-11-06-general' or 
                  (year >= 2008 and year <= 2011)):
                if slug == 'wa-2011-08-16-primary':
                    # The 2011-08-16 election doesn't have any contests of interest for
                    # OpenElections
                    continue

                meta_entries.extend(self._build_metadata_state_county(election))
                meta_entries.extend(self._build_metadata_url_paths(election))

            elif year >= 2012 and year <= 2013:
                meta_entries.extend(self._build_metadata_url_paths(election))
            else:
                msg = ("Not sure how to define mappings for election {}.  "
                       "Please update openelex.us.wa.datasource").format(slug)
                raise NotImplemented(msg)

        return meta_entries
dataset/ETHPy150Open openelections/openelections-core/openelex/us/wa/datasource.py/Datasource._build_metadata/original