def get_leader(self):
        """
        Finds the leader of the ladder
        """
        totals = {}
        for result in self.result_set.filter(ladder=self):
            try:
                if result.result == 9:
                    totals[result.player] += int(result.result) + 3
                else:
                    totals[result.player] += int(result.result) + 1
            except __HOLE__:
                if result.result == 9:
                    totals[result.player] = int(result.result) + 3
                else:
                    totals[result.player] = int(result.result) + 1

        if totals:
            player = max(iter(totals.items()), key=operator.itemgetter(1))[0]
        else:
            return {'player': 'No Results', 'player_id': '../#', 'total': '-', 'division': self.division}

        return {'player': player.__str__(), 'player_id': player.id, 'total': totals[player], 'division': self.division}
dataset/ETHPy150Open jzahedieh/django-tennis-ladder/ladder/models.py/Ladder.get_leader