// cons prepends the "head" componentFn to the "tail" of componentFn's.
558089
func cons(head componentFn, tail []componentFn) []componentFn {
	return append([]componentFn{head}, tail...)
}
819114
func And(conds ...Cond) Cond {
	var result = make(condAnd, 0, len(conds))
	for _, cond := range conds {
		if cond == nil || !cond.IsValid() {
			continue
		}
		result = append(result, cond)
	}
	return result
}
448148
func NewStrings(less func(x, y string) bool, cap int) *Strings {
	h := &Strings{}

	if less != nil {
		h.less = func(i, j int) bool {
			return less(h.list[i], h.list[j])
		}
	}
	if cap > 0 {
		h.list = make([]string, 0, cap)
	}
	return h
}
580728
func (c *Option) AddSubComponent(name string, sub *Component) *Option {
	c.coms[name] = sub
	return c
}
1169576
func Components(g Iterator) [][]int {
	sets, count := components(g)

	m := make([][]int, g.Order())
	for v := range m {
		x := sets.find(v)
		m[x] = append(m[x], v)
	}

	components := make([][]int, 0, count)
	for _, comp := range m {
		if comp != nil {
			components = append(components, comp)
		}
	}
	return components
}
775912
func Main(options DoOptions) {
	if err := Do(options); err != nil {
		fmt.Fprintf(os.Stderr, "%s\n", err.Error())
		os.Exit(1)
	}
	os.Exit(0)
}
241480
func (cons *Console) Configure(conf core.PluginConfigReader) {
	switch strings.ToLower(cons.pipeName) {
	case "stdin":
		cons.pipe = os.Stdin
		cons.pipeName = "stdin"
	default:
		cons.pipe = nil
	}
}
115579
func (as ArraySpec) Cos() Input {
	return as.proc(func(i Input) Input {
		return i.Cos()
	})
}
1368952
func diffTagsSfn(oldTags, newTags []*sfn.Tag) ([]*sfn.Tag, []*sfn.Tag) {
	// First, we're creating everything we have
	create := make(map[string]interface{})
	for _, t := range newTags {
		create[aws.StringValue(t.Key)] = aws.StringValue(t.Value)
	}

	// Build the list of what to remove
	var remove []*sfn.Tag
	for _, t := range oldTags {
		old, ok := create[aws.StringValue(t.Key)]
		if !ok || old != aws.StringValue(t.Value) {
			// Delete it!
			remove = append(remove, t)
		} else if ok {
			// already present so remove from new
			delete(create, aws.StringValue(t.Key))
		}
	}

	return tagsFromMapSfn(create), remove
}
1282304
func NormalizeConditions(columnConditions map[string][]*Condition) []*ColumnCondition {
	var cc []*ColumnCondition

	for column, conds := range columnConditions {
		for _, cond := range conds {
			cc = append(cc, &ColumnCondition{
				Name:      column,
				Condition: cond})
		}
	}

	sort.Sort(sortedColumnCondition(cc))
	return cc
}
583078
func (engine *Engine) Delims(left, right string) *Engine {
	engine.delims = render.Delims{Left: left, Right: right}
	return engine
}
971528
func (a AboutMenuItemDef) Props() AboutMenuItemProps {
	uprops := a.ComponentDef.Props()
	return uprops.(AboutMenuItemProps)
}
122974
func (c *Config) MergeIn(cfgs ...*Config) {
	for _, other := range cfgs {
		mergeInConfig(c, other)
	}
}
1106817
func (hds Heads) Less(i int, j int) bool {
	return hds[i].X() < hds[j].X() || (hds[i].X() == hds[j].X() &&
		hds[i].Y() < hds[j].Y())
}
710122
func Wrap(head error, next error) error {
	if head == nil {
		// The state head==nil && next!=nil is very strange so I leave it as nil
		return nil
	}
	if next == nil {
		return head
	}
	tail := Tail(next)
	return &ErrorChain{
		head: head,
		next: next,
		tail: tail,
	}
}
901682
func (e Equalities) AddFuncs(funcs ...interface{}) error {
	for _, f := range funcs {
		if err := e.AddFunc(f); err != nil {
			return err
		}
	}
	return nil
}
216317
func components(c context.Context, b *buildbot.Build) (result []*ui.BuildComponent) {
	for _, step := range b.Steps {
		if step.Hidden == true {
			continue
		}
		bc := &ui.BuildComponent{
			Label: ui.NewEmptyLink(step.Name),
		}
		// Step text sometimes contains <br>, which we want to parse into new lines.
		bc.Text = step.Text

		// Figure out the status.
		if !step.IsStarted {
			bc.Status = model.NotRun
		} else {
			bc.Status = step.Results.Status()
		}

		remainingAliases := stringset.New(len(step.Aliases))
		for linkAnchor := range step.Aliases {
			remainingAliases.Add(linkAnchor)
		}

		getLinksWithAliases := func(logLink *ui.Link, isLog bool) ui.LinkSet {
			// Generate alias links.
			var aliases ui.LinkSet
			if remainingAliases.Del(logLink.Label) {
				stepAliases := step.Aliases[logLink.Label]
				aliases = make(ui.LinkSet, len(stepAliases))
				for i, alias := range stepAliases {
					aliases[i] = alias.Link()
				}
			}

			// Step log link takes primary, with aliases as secondary.
			links := make(ui.LinkSet, 1, 1+len(aliases))
			links[0] = logLink

			for _, a := range aliases {
				a.Alias = true
			}
			return append(links, aliases...)
		}

		for _, l := range step.Logs {
			ariaName := l.Name
			switch ariaName {
			case "stdio":
				ariaName = "standard i/o"
			case "stdout":
				ariaName = "standard out"
			case "stderr":
				ariaName = "standard error"
			}
			logLink := ui.NewLink(l.Name, l.URL, fmt.Sprintf("log %s for step %s", ariaName, step.Name))

			links := getLinksWithAliases(logLink, true)
			if logLink.Label == "stdio" {
				bc.MainLink = links
			} else {
				bc.SubLink = append(bc.SubLink, links)
			}
		}

		// Step links are stored as maps of name: url
		// Because Go doesn't believe in nice things, we now create another array
		// just so that we can iterate through this map in order.
		names := make([]string, 0, len(step.Urls))
		for name := range step.Urls {
			names = append(names, name)
		}
		sort.Strings(names)
		for _, name := range names {
			logLink := ui.NewLink(name, step.Urls[name], fmt.Sprintf("step link %s for step %s", name, step.Name))

			bc.SubLink = append(bc.SubLink, getLinksWithAliases(logLink, false))
		}

		// Add any unused aliases directly.
		if remainingAliases.Len() > 0 {
			unusedAliases := remainingAliases.ToSlice()
			sort.Strings(unusedAliases)

			for _, label := range unusedAliases {
				var baseLink ui.LinkSet
				for _, alias := range step.Aliases[label] {
					aliasLink := alias.Link()
					if len(baseLink) == 0 {
						aliasLink.Label = label
					} else {
						aliasLink.Alias = true
					}
					baseLink = append(baseLink, aliasLink)
				}

				if len(baseLink) > 0 {
					bc.SubLink = append(bc.SubLink, baseLink)
				}
			}
		}

		// Copy times.
		times := step.Times
		if times.Finish.IsZero() {
			times.Finish = b.Times.Finish
		}
		bc.ExecutionTime = ui.NewInterval(c, times.Start.Time, times.Finish.Time)
		result = append(result, bc)
	}
	return
}