def manage_monitor(hostname, username, password, monitor_type, name, **kwargs):

    ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}

    if __opts__['test']:

        params = {
            'hostname': hostname,
            'username': username,
            'password': password,
            'monitor_type': monitor_type,
            'name': name
        }

        for key, value in six.iteritems(kwargs):
            params[key] = value

        return _test_output(ret, 'manage', params)

    #is this monitor currently configured?
    existing = __salt__['bigip.list_monitor'](hostname, username, password, monitor_type, name)

    # if it exists
    if existing['code'] == 200:

        #modify the monitor
        modified = __salt__['bigip.modify_monitor'](hostname, username, password, monitor_type, name, **kwargs)

        #was the modification successful?
        if modified['code'] == 200:
            del existing['content']['selfLink']
            del modified['content']['selfLink']
            ret = _check_for_changes('Monitor', ret, existing, modified)
        else:
            ret = _load_result(modified, ret)

    # if it doesn't exist
    elif existing['code'] == 404:

        response = __salt__['bigip.create_monitor'](hostname, username, password, monitor_type, name, **kwargs)
        if response['code'] == 200:
            ret['result'] = True
            ret['changes']['old'] = {}
            ret['changes']['new'] = response['content']
            ret['comment'] = 'Monitor was successfully created.'
        else:
            ret = _load_result(response, ret)

    # else something else was returned
    else:
        ret = _load_result(existing, ret)

    return ret
Return True if the window still exists.
dataset/ETHPy150Open saltstack/salt/salt/states/bigip.py/manage_monitor--crossover with--dataset/ETHPy150Open neovim/python-client/neovim/api/window.py/Window.valid