def _build_state_leg_url(self, year, party=""):
        tmplt = self.base_url + "State_Legislative_Districts"
        kwargs = {'year': year}
        year_int = int(year)
        # PRIMARY
        # Assume it's a primary if party is present
        if party and year_int > 2000:
            kwargs['party'] = party
            if year_int == 2004:
                tmplt += "_%(party)s_Primary_%(year)s"
            else:
                tmplt += "_%(party)s_%(year)s_Primary"
        # GENERAL
        else:
            # 2000 and 2004 urls end in the 4-digit year
            if (2000, 2004) in year_int:
                tmplt += "_General_%(year)s"
            # All others have the year preceding the race type (General/Primary)
            else:
                tmplt += "_%(year)s_General"
        tmplt += ".csv"
        return tmplt % kwargs
dataset/ETHPy150Open openelections/openelections-core/openelex/us/md/datasource.py/Datasource._build_state_leg_url/swapped operands of `in`