def _has_valid_owner(self, entity, db: 'EntityDB') -> bool:
    if (entity.dxf.owner is None):
        return False
    owner = db.get(entity.dxf.owner)
    if ((owner is None) or (not owner.is_alive)):
        return False
    valid = (owner.dxf.layout != '0')
    if (not valid):
        logger.debug(f'{str(entity)} in {str(self)} is located in a block layout, which is not allowed')
    return valid
def _has_valid_owner(self, entity, db: 'EntityDB') -> bool:
    if (entity.dxf.owner is None):
        return False
    owner = db.get(entity.dxf.owner)
    if ((owner is None) or (not owner.is_alive)):
        return False
    valid = (owner.dxf.layout != '0')
    if (not valid):
        logger.debug(f'{str(entity)} in {str(self)} is located in a block layout, which is not allowed')
    return valid