// DecodeHistoryRemove ...
480788
func (d *ProtobufDecoder) DecodeHistoryRemove(data []byte) (*HistoryRemoveRequest, error) {
	var p HistoryRemoveRequest
	err := p.Unmarshal(data)
	if err != nil {
		return nil, err
	}
	return &p, nil
}
322319
func (r *PrevRevisions) Cleanup() {
	r.mu.Lock()
	defer r.mu.Unlock()

	r.revisions = make(map[string]datasync.KeyVal)
}
712995
func (_m *APIClient) ContainerRemove(ctx context.Context, _a1 string, options types.ContainerRemoveOptions) error {
	ret := _m.Called(ctx, _a1, options)

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, types.ContainerRemoveOptions) error); ok {
		r0 = rf(ctx, _a1, options)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
1215726
func MapRemoveByKeyOp(binName string, key interface{}, returnType mapReturnType) *Operation {
	return newCDTCreateOperationValue1(_CDT_MAP_REMOVE_BY_KEY, _MAP_MODIFY, binName, key, returnType)
}
852108
func (c *Connector) MultiRemove(ctx context.Context, ei *dosa.EntityInfo, multiValues []map[string]dosa.FieldValue) ([]error, error) {
	// Note we do not lock here. This is representative of the behavior one would see in a deployed environment
	var errs []error
	for _, v := range multiValues {
		errs = append(errs, c.Remove(ctx, ei, v))
	}

	return errs, nil
}
421574
func (h *History) Clear() {
	h.tmp = make([]string, len(h.histories))
	for i := range h.histories {
		h.tmp[i] = h.histories[i]
	}
	h.tmp = append(h.tmp, "")
	h.selected = len(h.tmp) - 1
}
813214
func (m *MockCommonAPIClient) ServiceRemove(ctx context.Context, serviceID string) error {
	ret := m.ctrl.Call(m, "ServiceRemove", ctx, serviceID)
	ret0, _ := ret[0].(error)
	return ret0
}
620410
func DecodeHandle(data []byte) (int64, error) {
	var h int64
	buf := bytes.NewBuffer(data)
	err := binary.Read(buf, binary.BigEndian, &h)
	return h, err
}
1110445
func DecodeHTTPDeleteSessionsByOwnerTokenRequest(ctx context.Context, r *http.Request) (interface{}, error) {
	values, ok := r.URL.Query()["ownerToken"]
	if !ok {
		return nil, kitty.WithErrQueryParam(errors.New("ownerToken parameter is required"), "ownerToken")
	}
	return deleteSessionsByOwnerTokenRequest{
		OwnerToken: values[0],
	}, nil
}
811362
func (d *driver) VolumeRemove(
	ctx types.Context,
	volumeID string,
	opts *types.VolumeRemoveOpts) error {

	d.Lock()
	defer d.Unlock()
	if err := d.refreshSession(ctx); err != nil {
		return err
	}

	fields := map[string]interface{}{
		"provider": vbox.Name,
		"volumeID": volumeID,
	}

	err := d.vbox.RemoveMedium(volumeID)
	if err != nil {
		return goof.WithFieldsE(fields, "error deleting volume", err)
	}

	return nil
}
538015
func RecheckDeletionTimestamp(getObject func() (metav1.Object, error)) func() error {
	return func() error {
		obj, err := getObject()
		if err != nil {
			return fmt.Errorf("can't recheck DeletionTimestamp: %v", err)
		}
		if obj.GetDeletionTimestamp() != nil {
			return fmt.Errorf("%v/%v has just been deleted at %v", obj.GetNamespace(), obj.GetName(), obj.GetDeletionTimestamp())
		}
		return nil
	}
}
1237459
func fromDecodeHookFunc(hook DecodeHookFunc) mapstructure.DecodeHookFuncType {
	return func(from, to reflect.Type, data interface{}) (interface{}, error) {
		var value reflect.Value
		if data != nil {
			value = reflect.ValueOf(data)
		} else {
			// mapstructure is pretty good about giving us non-nil data but
			// let's process it gracefully anyway.
			value = reflect.Zero(from)
		}

		out, err := hook(from, to, value)
		if err != nil {
			return nil, err
		}

		return out.Interface(), nil
	}
}
855131
func (h *apiExecutor) HistoryRemove(ctx context.Context, cmd *HistoryRemoveRequest) *HistoryRemoveResponse {
	defer func(started time.Time) {
		apiCommandDurationSummary.WithLabelValues(h.protocol, "history_remove").Observe(time.Since(started).Seconds())
	}(time.Now())

	resp := &HistoryRemoveResponse{}

	ch := cmd.Channel

	if ch == "" {
		resp.Error = ErrorBadRequest
		return resp
	}

	chOpts, ok := h.node.ChannelOpts(ch)
	if !ok {
		resp.Error = ErrorNamespaceNotFound
		return resp
	}

	if chOpts.HistorySize <= 0 || chOpts.HistoryLifetime <= 0 {
		resp.Error = ErrorNotAvailable
		return resp
	}

	err := h.node.RemoveHistory(ch)
	if err != nil {
		h.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, "error calling history remove", map[string]interface{}{"error": err.Error()}))
		resp.Error = ErrorInternal
		return resp
	}

	return resp
}
1254581
func (c *Core) RekeyDeleteBackup(ctx context.Context, recovery bool) logical.HTTPCodedError {
	if c.Sealed() {
		return logical.CodedError(http.StatusServiceUnavailable, consts.ErrSealed.Error())
	}
	if c.standby {
		return logical.CodedError(http.StatusBadRequest, consts.ErrStandby.Error())
	}

	c.rekeyLock.Lock()
	defer c.rekeyLock.Unlock()

	if recovery {
		err := c.physical.Delete(ctx, coreRecoveryUnsealKeysBackupPath)
		if err != nil {
			return logical.CodedError(http.StatusInternalServerError, errwrap.Wrapf("error deleting backup keys: {{err}}", err).Error())
		}
		return nil
	}
	err := c.physical.Delete(ctx, coreBarrierUnsealKeysBackupPath)
	if err != nil {
		return logical.CodedError(http.StatusInternalServerError, errwrap.Wrapf("error deleting backup keys: {{err}}", err).Error())
	}
	return nil
}
1169888
func decodeHeaders(r io.Reader) (transport.Headers, error) {
	reader := internal.NewReader(r)

	count := reader.ReadUint16()
	if count == 0 {
		return transport.Headers{}, reader.Err()
	}

	headers := transport.NewHeadersWithCapacity(int(count))
	for i := 0; i < int(count) && reader.Err() == nil; i++ {
		k := reader.ReadLen16String()
		v := reader.ReadLen16String()
		headers = headers.With(k, v)
	}

	return headers, reader.Err()
}
1184563
func (d *driver) SnapshotRemove(
	ctx types.Context,
	snapshotID string,
	opts types.Store) error {
	// TODO Snapshots are not implemented yet
	return types.ErrNotImplemented
}
1132695
func (h *Plus) decodeHash(k uint32) (uint32, uint8) {
	var r uint8
	if k&1 == 1 {
		r = uint8(bextr32(k, 1, 6)) + h.pp - h.p
	} else {
		r = uint8(bits.LeadingZeros32(k<<(32-h.pp+h.p-1)) + 1)
	}
	return h.getIndex(k), r
}