strip the outputs from a notebook object

def strip_output(nb):
    """
    strip the outputs from a notebook object
    """
    for cell in nb.worksheets[0].cells:
        if 'outputs' in cell:
            cell['outputs'] = []
        if 'prompt_number' in cell:
            cell['prompt_number'] = None
    return nb