def _get_office(self, raw_result):
        office_query = {
            'state': STATE,
            'name': self._clean_office(raw_result.office)
        }

        if office_query['name'] is 'President':
            office_query['state'] = 'US'

        if office_query['name'] in self.district_offices:
            #if raw_result.district:
                office_query['district'] = raw_result.district or ''

        key = Office.make_key(**office_query)

        try:
            return self._office_cache[key]
        except __HOLE__:
            try:
                office = Office.objects.get(**office_query)
                assert key == office.key
                self._office_cache[key] = office
                return office
            except Office.DoesNotExist:
                logger.error("\tNo office matching query {}".format(office_query))
                raise
dataset/ETHPy150Open openelections/openelections-core/openelex/us/wa/transform/__init__.py/BaseTransform._get_office