def _build_county_url(self, year, name, party='', precinct=False):
        url_kwargs = {
            'year': year,
            'race_type': 'General'
        }
        # In 2000, 2004 the files for St. Mary's county are prefixed
        # with "Saint_Marys" instead of "St._Marys".
        if name == "St._Marys" and int(year) in (2000, 2004):
            name = "Saint_Marys"
        tmplt = self.base_url + name
        if precinct:
            tmplt += "_By_Precinct"
        else:
            # 2000/2004 don't use "_County" in file names
            if int(year) not in (2000, 2004):
                tmplt += "_County"
        if party:
            url_kwargs['party'] = party
            url_kwargs['race_type'] = 'Primary'
            tmplt += "_%(party)s"
        if int(year) in (2000, 2004):
            tmplt += "_%(race_type)s_%(year)s.csv"
        else:
            tmplt += "_%(year)s_%(race_type)s.csv"
        return tmplt % url_kwargs
dataset/ETHPy150Open openelections/openelections-core/openelex/us/md/datasource.py/Datasource._build_county_url/original