def notebook_executed(pth):
    """Determine whether the notebook at `pth` has been executed."""

    nb = nbformat.read(pth, as_version=4)
    for n in range(len(nb['cells'])):
        if nb['cells'][n].cell_type == 'code' and \
                nb['cells'][n].execution_count is None:
            return False
    return True
Determine whether the notebook at `pth` has been executed.