def decrement(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT):
    '''
    Decrement the value of a key

    CLI Example:

    .. code-block:: bash

        salt '*' memcached.decrement <key>
        salt '*' memcached.decrement <key> 2
    '''
    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 '
            'decremented'.format(key)
        )

    try:
        return conn.decr(key, delta)
    except __HOLE__:
        raise SaltInvocationError('Delta value must be an integer')
dataset/ETHPy150Open saltstack/salt/salt/modules/memcached.py/decrement