// ListRemoveOp creates a list remove operation.
// Server removes item at specified index from list bin.
// Server returns number of items removed.
187361
func ListRemoveOp(binName string, index int) *Operation {
	return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE, IntegerValue(index)}, encoder: listGenericOpEncoder}
}
438246
func (list *List) Exit() {

	// Should go down to the last option
	for list.Index != len(list.options) {
		list.Index++
		list.Cursor.MoveDown(1)
	}

	list.Println()
	list.Println()
	list.Print(ShowCursor)

	os.Exit(1)
}
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
}
529565
func (l *List) Remove() error {
	// Remove the table
	_, err := l.host.db.Exec("DROP TABLE " + l.table)
	return err
}
1284848
func ListRemoveByValueOp(binName string, value interface{}, returnType ListReturnType) *Operation {
	return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE, IntegerValue(returnType), NewValue(value)}, encoder: listGenericOpEncoder}
}
1058411
func finalAppCharmRemoveOps(appName string, curl *charm.URL) []txn.Op {
	settingsKey := applicationCharmConfigKey(appName, curl)
	removeSettingsOp := txn.Op{
		C:      settingsC,
		Id:     settingsKey,
		Remove: true,
	}
	// ensure removing storage constraints doc
	storageConstraintsKey := applicationStorageConstraintsKey(appName, curl)
	removeStorageConstraintsOp := removeStorageConstraintsOp(storageConstraintsKey)
	// ensure removing device constraints doc
	deviceConstraintsKey := applicationDeviceConstraintsKey(appName, curl)
	removeDeviceConstraintsOp := removeDeviceConstraintsOp(deviceConstraintsKey)

	cleanupOp := newCleanupOp(cleanupCharm, curl.String())
	return []txn.Op{removeSettingsOp, removeStorageConstraintsOp, removeDeviceConstraintsOp, cleanupOp}
}
593559
func (cli *Client) ImageRemove(ctx context.Context, imageID string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
	query := url.Values{}

	if options.Force {
		query.Set("force", "1")
	}
	if !options.PruneChildren {
		query.Set("noprune", "1")
	}

	var dels []types.ImageDeleteResponseItem
	resp, err := cli.delete(ctx, "/images/"+imageID, query, nil)
	defer ensureReaderClosed(resp)
	if err != nil {
		return dels, wrapResponseError(err, resp, "image", imageID)
	}

	err = json.NewDecoder(resp.body).Decode(&dels)
	return dels, err
}
578956
func (ns nsRefcounts_) JustRemoveOp(collName, key string, count int) txn.Op {
	op := txn.Op{
		C:      collName,
		Id:     key,
		Remove: true,
	}
	if count >= 0 {
		op.Assert = bson.D{{"refcount", count}}
	}
	return op
}
600714
func (deque *keyedDeque) Remove(e *list.Element) (v interface{}) {
	deque.RLock()
	key, ok := deque.invertedIndex[e]
	deque.RUnlock()

	if ok {
		v = deque.Delete(key)
	}

	return
}
561986
func (c *Container) ProcessRemove(id string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	delete(c.processes, id)
}
10335
func SliceRemove(slice []interface{}, start int, args ...int) []interface{} {
	var end int
	if len(args) == 0 {
		end = start + 1
	} else {
		end = args[0]
	}
	if end > len(slice)-1 {
		return slice[:start]
	}
	return append(slice[:start], slice[end:]...)
}
852205
func (l *List) Remove(e Element) {
	prev := ElementMapper{}.linkerFor(e).Prev()
	next := ElementMapper{}.linkerFor(e).Next()

	if prev != nil {
		ElementMapper{}.linkerFor(prev).SetNext(next)
	} else {
		l.head = next
	}

	if next != nil {
		ElementMapper{}.linkerFor(next).SetPrev(prev)
	} else {
		l.tail = prev
	}
}
314114
func (s *Storage) ListDeleted() ([]*rspb.Release, error) {
	s.Log("listing deleted releases in storage")
	return s.Driver.List(func(rls *rspb.Release) bool {
		return relutil.StatusFilter(rspb.Status_DELETED).Check(rls)
	})
}
598403
func ListSortOp(binName string, sortFlags int) *Operation {
	return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_SORT, IntegerValue(sortFlags)}, encoder: listGenericOpEncoder}
}
643645
func RunRemove(dockerCli command.Cli, opts options.Remove) error {
	client := dockerCli.Client()
	ctx := context.Background()

	var errs []string
	for _, namespace := range opts.Namespaces {
		services, err := getStackServices(ctx, client, namespace)
		if err != nil {
			return err
		}

		networks, err := getStackNetworks(ctx, client, namespace)
		if err != nil {
			return err
		}

		var secrets []swarm.Secret
		if versions.GreaterThanOrEqualTo(client.ClientVersion(), "1.25") {
			secrets, err = getStackSecrets(ctx, client, namespace)
			if err != nil {
				return err
			}
		}

		var configs []swarm.Config
		if versions.GreaterThanOrEqualTo(client.ClientVersion(), "1.30") {
			configs, err = getStackConfigs(ctx, client, namespace)
			if err != nil {
				return err
			}
		}

		if len(services)+len(networks)+len(secrets)+len(configs) == 0 {
			fmt.Fprintf(dockerCli.Err(), "Nothing found in stack: %s\n", namespace)
			continue
		}

		hasError := removeServices(ctx, dockerCli, services)
		hasError = removeSecrets(ctx, dockerCli, secrets) || hasError
		hasError = removeConfigs(ctx, dockerCli, configs) || hasError
		hasError = removeNetworks(ctx, dockerCli, networks) || hasError

		if hasError {
			errs = append(errs, fmt.Sprintf("Failed to remove some resources from stack: %s", namespace))
		}
	}

	if len(errs) > 0 {
		return errors.Errorf(strings.Join(errs, "\n"))
	}
	return nil
}
1323027
func (l *list) Remove(pos uint) (PersistentList, error) {
	if pos == 0 {
		nl, _ := l.Tail()
		return nl, nil
	}

	nl, err := l.tail.Remove(pos - 1)
	if err != nil {
		return nil, err
	}
	return &list{l.head, nl}, nil
}
987604
func (l *list) remove(e *element) *element {
	e.prev.next = e.next
	e.next.prev = e.prev
	e.next = nil // avoid memory leaks
	e.prev = nil // avoid memory leaks
	e.list = nil
	l.len--
	return e
}