def get_contest(self, raw_result):
        key = "%s-%s" % (raw_result.election_id, raw_result.contest_slug)

        try:
            #print self._contest_cache[key]
            return self._contest_cache[key]
        except KeyError:
            #raise
            fields = self.get_contest_fields(raw_result)
            #print fields
            #quit(fields['source'])
            fields.pop('source')
            try:
                #contest = Contest.objects.get(**fields)
                try:
                    contest = Contest.objects.filter(**fields)[0]
                except IndexError:
                    contest = Contest.objects.get(**fields)
                #print contest
                #quit("uuuuuuuuuuuu")
            except Exception:
                print fields
                print "\n"
                raise
            self._contest_cache[key] = contest
            return contest
Returns the Contest model instance for a given RawResult.
dataset/ETHPy150Open openelections/openelections-core/openelex/us/wa/transform/__init__.py/BaseTransform.get_contest