def get_locations_from_ids(location_ids, domain):
    location_ids = list(set(location_ids))
    expected_count = len(location_ids)

    locations = SQLLocation.objects.filter(
        domain=domain,
        is_archived=False,
        location_id__in=location_ids,
    )
    if len(locations) != expected_count:
        raise SQLLocation.DoesNotExist('One or more of the locations was not found.')
    return locations
Returns the SQLLocations with the given location_ids, ensuring
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/locations/util.py/get_locations_from_ids