def keepCells(notebook):
    """
    Finds the tag 'keep' in any cell and if it exists,
    remove the ones that don't have it

    Returns dict without 'hide' tagged cells
    """
    has_keep = False
    for cell in notebook['cells']:
        try:
            if 'keep' in cell['metadata']['tags']:
                has_keep = True
                break
        except KeyError:
            pass

    if has_keep:
        clean = []
        for cell in notebook['cells']:
            try:
                if 'keep' in cell['metadata']['tags']:
                    
                    clean.append(cell)
            except KeyError:
                pass

        
        notebook['cells'] = clean

    return notebook