def scrub_output_pre_save(model, **kwargs):
    """scrub output before saving notebooks"""
    if model['type'] != 'notebook':
        return
    if model['content']['nbformat'] != 4:
        return
    for cell in model['content']['cells']:
        if cell['cell_type'] != 'code':
            continue
        cell['outputs'] = []
        cell['execution_count'] = None
