<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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