def __init__(self, *args, **kwargs):
        from corehq.apps.locations.util import get_lineage_from_location, get_lineage_from_location_id
        if kwargs in 'parent':
            parent = kwargs['parent']
            if parent:
                if isinstance(parent, Document):
                    lineage = get_lineage_from_location(parent)
                else:
                    # 'parent' is a doc id
                    lineage = get_lineage_from_location_id(parent)
            else:
                lineage = []
            kwargs['lineage'] = lineage
            del kwargs['parent']

        location_type = kwargs.pop('location_type', None)
        super(Document, self).__init__(*args, **kwargs)
        if location_type:
            self.location_type = location_type
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/locations/models.py/Location.__init__/swapped operands of `in`