def increment(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT):
    conn = _connect(host, port)
    _check_stats(conn)
    cur = get(key)

    if cur is None:
        raise CommandExecutionError('Key \'{0}\' does not exist'.format(key))
    elif not isinstance(cur, integer_types):
        raise CommandExecutionError(
            'Value for key \'{0}\' must be an integer to be '
            'incremented'.format(key)
        )

    try:
        return conn.incr(key, delta)
    except ValueError:
        raise SaltInvocationError('Delta value must be an integer')
Increment the value of a key
dataset/ETHPy150Open saltstack/salt/salt/modules/memcached.py/increment