<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def delete(overlay):
    '''
    Remove the given overlay from the your locally installed overlays.
    Specify 'ALL' to remove all overlays.

    Return a list of the overlays(s) that were removed:

    CLI Example:

    .. code-block:: bash

        salt '*' layman.delete <overlay name>
    '''
    ret = list()
    old_overlays = list_local()
    cmd = 'layman --quietness=0 --delete {0}'.format(overlay)
    delete_attempt = __salt__['cmd.run_all'](cmd, python_shell=False)
    if delete_attempt['retcode'] != 0:
        raise salt.exceptions.CommandExecutionError(delete_attempt['stdout'])
    new_overlays = list_local()

    # If we now have no overlays added, We need to ensure that the make.conf
    # does not source layman's make.conf, as it will break emerge
    if not new_overlays:
        srcline = 'source /var/lib/layman/make.conf'
        makeconf = _get_makeconf()
        if __salt__['file.contains'](makeconf, 'layman'):
            __salt__['file.sed'](makeconf, srcline, '')

    ret = [overlay for overlay in old_overlays if overlay not in new_overlays]
    return ret