def METHOD_NAME(election_id, version):
    party_id = version["data"]["party_memberships"][election_id]["id"]
    try:
        return party_legacy_id_to_ec_id[party_id]
    except KeyError:
        return party_legacy_id_to_ec_id["minor-{}".format(party_id)]