// Helper functions for common node lists. They may be empty.
9373
func walkIdentList(v Visitor, list []*ast.Ident) {
	for i, x := range list {
		walkToReplace(v, x, func(r ast.Node) {
			list[i] = r.(*ast.Ident)
		})
	}
}
1328058
func getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node {
	return mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
		return getChildrenWithSiblingType(n, st, nil, nil)
	})
}
1264992
func (t *Tree) itemList() (list *ListNode, next Node) {
	list = t.newList(t.peekNonSpace().pos)
	for t.peekNonSpace().typ != itemEOF {
		n := t.textOrAction()
		switch n.Type() {
		case nodeEnd, nodeElse:
			return list, n
		}
		list.append(n)
	}
	t.errorf("unexpected EOF")
	return
}
1348955
func (s *nodeLister) List(selector labels.Selector) (ret []*v1.Node, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.Node))
	})
	return ret, err
}
355938
func (db *NodeSet) NodeList() NodeList {
	db.lock.RLock()
	defer db.lock.RUnlock()

	var values NodeList
	for _, key := range db.order {
		values = append(values, db.nodes[key])
	}
	return values
}
789288
func ConcatLists(a *SexpPair, bs []Sexp) (Sexp, error) {
	result := a
	for _, b := range bs {
		res, err := ConcatTwoLists(result, b)
		if err != nil {
			return SexpNull, err
		}
		x, ok := res.(*SexpPair)
		if !ok {
			return SexpNull, NotAList
		}
		result = x
	}
	return result, nil
}
359859
func (exp *GetAttrExpr) All() []Node {
	res := []Node{exp.Cont, exp.Attr}
	for _, v := range exp.Args {
		res = append(res, v)
	}
	return res
}
1154770
func (c *Catalog) ListNodes(args *structs.DCSpecificRequest, reply *structs.IndexedNodes) error {
	if done, err := c.srv.forward("Catalog.ListNodes", args, args, reply); done {
		return err
	}

	filter, err := bexpr.CreateFilter(args.Filter, nil, reply.Nodes)
	if err != nil {
		return err
	}

	return c.srv.blockingQuery(
		&args.QueryOptions,
		&reply.QueryMeta,
		func(ws memdb.WatchSet, state *state.Store) error {
			var index uint64
			var nodes structs.Nodes
			var err error
			if len(args.NodeMetaFilters) > 0 {
				index, nodes, err = state.NodesByMeta(ws, args.NodeMetaFilters)
			} else {
				index, nodes, err = state.Nodes(ws)
			}
			if err != nil {
				return err
			}

			reply.Index, reply.Nodes = index, nodes
			if err := c.srv.filterACL(args.Token, reply); err != nil {
				return err
			}

			raw, err := filter.Execute(reply.Nodes)
			if err != nil {
				return err
			}
			reply.Nodes = raw.(structs.Nodes)

			return c.srv.sortNodesByDistanceFrom(args.Source, reply.Nodes)
		})
}
95266
func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node {
	if len(nodes)+len(sel.Nodes) < minNodesForSet {
		return grep(sel, func(i int, s *Selection) bool {
			return isInSlice(nodes, s.Get(0)) == keep
		})
	}

	set := make(map[*html.Node]bool)
	for _, n := range nodes {
		set[n] = true
	}
	return grep(sel, func(i int, s *Selection) bool {
		return set[s.Get(0)] == keep
	})
}
329443
func FindAll(node *parser.Node, cmd string) []int {
	if node == nil {
		return nil
	}
	var indices []int
	for i, child := range node.Children {
		if child != nil && child.Value == cmd {
			indices = append(indices, i)
		}
	}
	return indices
}
877299
func (c *FakeNodeMetricses) List(opts v1.ListOptions) (result *v1beta1.NodeMetricsList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootListAction(nodemetricsesResource, nodemetricsesKind, opts), &v1beta1.NodeMetricsList{})
	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &v1beta1.NodeMetricsList{ListMeta: obj.(*v1beta1.NodeMetricsList).ListMeta}
	for _, item := range obj.(*v1beta1.NodeMetricsList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
1037391
func nodeMatches(s *api.Service, n *api.Node) bool {
	if n == nil {
		return false
	}

	constraints, _ := constraint.Parse(s.Spec.Task.Placement.Constraints)
	return constraint.NodeMatches(constraints, n)
}
1309802
func (n *node) isEmpty() bool {
	if len(n.elements) == 0 {
		if n.next == nil || n.next.numNodes() == 0 {
			return true
		}
	}
	return false
}
124921
func (c *client) NodeList() ([]*Node, error) {
	var out []*Node
	uri := fmt.Sprintf(pathNodes, c.addr)
	err := c.get(uri, &out)
	return out, err
}
1157582
func (s *GlobalStore) Nodes(startAddr *common.Address, limit int) (nodes mock.Nodes, err error) {
	s.mu.RLock()
	defer s.mu.RUnlock()

	var i int
	if startAddr != nil {
		i, _ = s.nodeIndex(*startAddr)
	}
	total := len(s.nodes)
	max := maxIndex(i, limit, total)
	nodes.Addrs = make([]common.Address, 0, max-i)
	for ; i < max; i++ {
		nodes.Addrs = append(nodes.Addrs, s.nodes[i])
	}
	if total > max {
		nodes.Next = &s.nodes[max]
	}
	return nodes, nil
}
168827
func (m *Mercury) ListNodeContainers(ctx context.Context, nodename string) ([]*types.Container, error) {
	key := fmt.Sprintf(nodeContainersKey, nodename, "")

	resp, err := m.Get(ctx, key, clientv3.WithPrefix())
	if err != nil {
		return []*types.Container{}, err
	}

	containers := []*types.Container{}
	for _, ev := range resp.Kvs {
		c := &types.Container{}
		if err := json.Unmarshal(ev.Value, c); err != nil {
			return []*types.Container{}, err
		}

		if c, err = m.bindContainerAdditions(ctx, c); err != nil {
			return []*types.Container{}, err
		}

		containers = append(containers, c)
	}
	return containers, nil
}
169269
func NodeList() (infos []*model.NodeListInfo, err error) {
	err = mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		var nodes []swarm.Node
		nodes, err = cli.NodeList(ctx, types.NodeListOptions{})
		if err == nil {
			sort.Slice(nodes, func(i, j int) bool {
				return nodes[i].Description.Hostname < nodes[j].Description.Hostname
			})
			infos = make([]*model.NodeListInfo, len(nodes))
			for i, n := range nodes {
				infos[i] = model.NewNodeListInfo(n)
			}
		}
		return
	})
	return
}