// Remove takes the state out of the pool and closes it, or marks it
// for removal if it's currently being used (indicated by Gets without
// corresponding Releases). The boolean result indicates whether or
// not the state was removed.
161204
func (p *StatePool) Remove(modelUUID string) (bool, error) {
	if modelUUID == p.systemState.ModelUUID() {
		// We do not monitor usage of the controller's state.
		return false, nil
	}

	p.mu.Lock()
	defer p.mu.Unlock()

	if p.pool == nil {
		return false, errors.New("pool is closed")
	}

	item, ok := p.pool[modelUUID]
	if !ok {
		// Don't require the client to keep track of what we've seen -
		// ignore unknown model uuids.
		return false, nil
	}
	item.remove = true
	return p.maybeRemoveItem(item)
}
998973
func (tree *MutableTree) Remove(key []byte) ([]byte, bool) {
	val, orphaned, removed := tree.remove(key)
	tree.addOrphans(orphaned)
	return val, removed
}
738349
func (p *IDPool) Remove(id ID) bool {
	p.mutex.Lock()
	defer p.mutex.Unlock()

	return p.idCache.remove(id)
}
55458
func (s *Session) Remove(ctx context.Context, key string) {
	sd := s.getSessionDataFromContext(ctx)

	sd.mu.Lock()
	defer sd.mu.Unlock()

	_, exists := sd.Values[key]
	if !exists {
		return
	}

	delete(sd.Values, key)
	sd.status = Modified
}
1021502
func (r *Service) Delete(key string) error {
	c := r.pool.Get()
	defer c.Close()

	_, err := c.Do("DEL", r.Config.Prefix+key)
	return err
}
1183747
func (c *Conn) Remove(key string) error {
	code, body, err := c.doREST("DELETE", key, nil)
	if err != nil {
		return err
	}
	if code == 404 {
		return ErrNotFound
	}
	if code != 204 {
		return &Error{string(body), code}
	}
	return nil
}
495525
func (m *NullClusterRemove) Remove(arg0 []api.Node, arg1 bool) error {
	return ErrNotImplemented
}
355742
func (l *txList) Remove(tx *types.Transaction) (bool, types.Transactions) {
	// Remove the transaction from the set
	nonce := tx.Nonce()
	if removed := l.txs.Remove(nonce); !removed {
		return false, nil
	}
	// In strict mode, filter out non-executable transactions
	if l.strict {
		return true, l.txs.Filter(func(tx *types.Transaction) bool { return tx.Nonce() > nonce })
	}
	return true, nil
}
952369
func Remove(t *Pot, v Val, pof Pof) (*Pot, int, bool) {
	return remove(t, v, pof)
}
1224191
func (c *ARCCache) Remove(key interface{}) {
	c.lock.Lock()
	defer c.lock.Unlock()
	if c.t1.Remove(key) {
		return
	}
	if c.t2.Remove(key) {
		return
	}
	if c.b1.Remove(key) {
		return
	}
	if c.b2.Remove(key) {
		return
	}
}
21572
func (sys *PolicySys) Remove(bucketName string) {
	sys.Lock()
	defer sys.Unlock()

	delete(sys.bucketPolicyMap, bucketName)
}
951572
func (m *SecureMap) Remove(key interface{}) {
	m.lock.Lock()
	delete(m.data, key)
	m.lock.Unlock()
}
101262
func (w *filePoller) Remove(name string) error {
	w.mu.Lock()
	defer w.mu.Unlock()
	return w.remove(name)
}
1001838
func (l *Lambda) remove(kind, name string, m map[string]interface{}) {
	l.log(kind, name, m, '-', red)
}
1058579
func (c Collector) Remove(k string) {
	if c.Has(k) {
		delete(c, k)
	}
}
851233
func (b *Bucket) Remove(key string, cas Cas) (Cas, error) {
	cas, _, err := b.remove(key, cas)
	return cas, err
}
207223
func (h *HashMap) Remove() error {
	err := (*bbolt.DB)(h.db).Update(func(tx *bbolt.Tx) error {
		return tx.DeleteBucket(h.name)
	})
	// Mark as removed by setting the name to nil
	h.name = nil
	return err
}