def _build_metadata_state_county(self, election, extra_statewide=None,
            office=None):
        """
        Generate mappings for the statewide and county CSV files.
        
        This method builds mappings for elections from 2007-2011 that
        have URLs like
        http://vote.wa.gov/results/YYYYMMDD/export/YYYYMMDD_CountyName.csv

        Elections starting in 2012 have very similar results portals.  They
        also provide all county results in a single CSV.  Finally, they
        provide precinct-level CSV data for some counties.  Unfortunately,
        the URLs have a trailing numeric identifier, which doesn't seem to be
        able to be predetermined.  For example the "1451" in
        http://vote.wa.gov/results/20121106/export/20121106_AllCounties_20121205_1451.csv
        
        Just handle these in url_paths.csv.

        Args:
            election: Election dict as returned by the Metadata API.
            extra_statewide: Array of extra names of statewide files.
            office: Office slug if the results are for a single office, e.g. the
                Presidential primary.
        """
        meta_entries = []

        for county in self._counties():
            if (election['slug'] == "wa-2009-08-18-primary" and
                    county['name'] in self.NO_2009_PRIMARY_RESULTS_COUNTIES):
                continue

            generated_filename = self._standardized_filename(election,
                extension=".csv", reporting_level='county',
                jurisdiction=county['name'], office=office)
            meta_entries.append({
                'generated_filename': generated_filename,
                'raw_url': self._state_county_csv_results_url(election, county['name']),
                'ocd_id': county['ocd_id'],
                'name': county['name'],
                'election': election['slug'],
            })

        # There's also a statewide results file that uses the same
        # URL format, but uses "AllState" instead of the county name.  
        # Include it in the mappings also.
        if extra_statewide is None:
            extra_statewide = ["AllState"]
        else:
            extra_statewide.append("AllState")

        for name in extra_statewide:
            filename_kwargs = {
                'extension': ".csv",
                'office': office,
            }
            meta_entries.append({
                'generated_filename': self._standardized_filename(election,
                    **filename_kwargs),
                'raw_url': self._state_county_csv_results_url(election, name),
                'ocd_id': 'ocd-division/country:us/state:wa',
                'name': "Washington", 
                'election': election['slug'],
            })

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