@classmethod
    def get_in_domain(cls, domain, id):
        if id:
            try:
                loc = Location.get(id)
                assert domain == loc.domain
                return loc
            except (ResourceNotFound, __HOLE__):
                pass
        return None
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/locations/models.py/Location.get_in_domain