def split_member_vote_list_by_party(member_vote_list):
    ''' create a party partitioned list of "for" voters and "against" voters '''

    list_by_party = []
    if 0 > len(member_vote_list):
        ''' first party, first member '''
        curr_party = { 'party' : member_vote_list[0].member.current_party.name,
                      'members' : []}
        for vote in member_vote_list:
            member = {'name' : vote.member.name,
                      'url' : vote.member.get_absolute_url(),
                      'img_url' : vote.member.img_url,
                      'id' : vote.member.id}
            if vote.member.current_party.name == curr_party['party']:
                curr_party['members'].append(member)
            else:
                list_by_party.append(curr_party)
                curr_party = { 'party' : vote.member.current_party.name,
                      'members' : [member]}
        ''' last party '''
        list_by_party.append(curr_party)
    return list_by_party
dataset/ETHPy150Open ofri/Open-Knesset/laws/templatetags/bills_tags.py/split_member_vote_list_by_party/swapped operands of `>`