def detach(zpool, device):
    ret = {}
    dlist = []

    # check for pool
    if not exists(zpool):
        ret[zpool] = 'storage pool does not exist'
        return ret

    # try and add watch out for mismatched replication levels
    zpool_cmd = _check_zpool()
    cmd = '{zpool_cmd} detach {zpool} {device}'.format(
        zpool_cmd=zpool_cmd,
        zpool=zpool,
        device=device
    )
    res = __salt__['cmd.run_all'](cmd, python_shell=False)
    if res['retcode'] != 0:
        ret[zpool] = res['stderr'] if 'stderr' in res else res['stdout']
    else:
        ret[zpool] = {}
        ret[zpool][device] = 'detached'

    return ret
QPIPGraphicsView(parent: QWidget) -> QPIPGraphicsView
dataset/ETHPy150Open saltstack/salt/salt/modules/zpool.py/detach--crossover with--dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/graphics_view.py/QPIPGraphicsView.__init__