// Fill returns a slice of inputs that has length n and every element is set to input.
350654
func Fill(n int, input Input) []Input {
	a := make([]Input, n)
	for i := range a {
		a[i] = input
	}
	return a
}
903699
func FillLeft(s string, w int) string {
	return DefaultCondition.FillLeft(s, w)
}
909645
func (sf64 *SliceFloat64) Append(num float64) {
	sf64.Elements = append(sf64.Elements, num)
}
1249030
func (p *Parser) fill() {
	p.offs += p.bsp
	left := len(p.bs) - p.bsp
	copy(p.readBuf[:left], p.readBuf[p.bsp:])
readAgain:
	n, err := 0, p.readErr
	if err == nil {
		n, err = p.src.Read(p.readBuf[left:])
		p.readErr = err
	}
	if n == 0 {
		if err == nil {
			goto readAgain
		}
		// don't use p.errPass as we don't want to overwrite p.tok
		if err != io.EOF {
			p.err = err
		}
		if left > 0 {
			p.bs = p.readBuf[:left]
		} else {
			p.bs = nil
		}
	} else {
		p.bs = p.readBuf[:left+n]
	}
	p.bsp = 0
}
533232
func (s *Set) Init(max uint32) {
	s.sparse = make([]uint32, max)
}
187472
func (as ArraySpec) Add(val Input) Input {
	return as.proc(func(i Input) Input {
		return i.Add(val)
	})
}
205642
func (g *groupReader) fill() bool {
	if g.next == nil {
		g.next = <-g.reader.C()
	}
	if g.next == nil {
		return false
	} else {
		g.key = g.tokey(g.next)
	}
	g.group = []Record{g.next}
	for {
		g.next = <-g.reader.C()
		var k []string
		if g.next != nil {
			k = g.tokey(g.next)
		}
		if g.next == nil || g.less(k, g.key) || g.less(g.key, k) {
			return true
		} else {
			g.group = append(g.group, g.next)
		}
	}
}
741586
func (s *Set) Add(els ...string) Set {
	if *s == nil {
		*s = make(Set)
	}
	for _, el := range els {
		(*s)[el] = struct{}{}
	}

	return *s
}
485196
func FillNilSlices(data interface{}) error {
	s := reflect.ValueOf(data).Elem()
	t := s.Type()

	for i := 0; i < s.NumField(); i++ {
		f := s.Field(i)
		tag := t.Field(i).Tag

		v := tag.Get("default")
		if len(v) > 0 {
			switch f.Interface().(type) {
			case []string:
				if f.IsNil() {
					// Treat the default as a comma separated slice
					vs := strings.Split(v, ",")
					for i := range vs {
						vs[i] = strings.TrimSpace(vs[i])
					}

					rv := reflect.MakeSlice(reflect.TypeOf([]string{}), len(vs), len(vs))
					for i, v := range vs {
						rv.Index(i).SetString(v)
					}
					f.Set(rv)
				}
			}
		}
	}
	return nil
}
264105
func (c C) Add(val Input) Input {
	if v, ok := val.(C); ok {
		return C(float32(v) + float32(c))
	}
	return val.Add(c)
}
431838
func FillPlan(nodesInfo []types.NodeInfo, need, limit int) ([]types.NodeInfo, error) {
	log.Debugf("[FillPlan] need %d limit %d", need, limit)
	nodesInfoLength := len(nodesInfo)
	sort.Slice(nodesInfo, func(i, j int) bool { return nodesInfo[i].Count > nodesInfo[j].Count })
	p := sort.Search(nodesInfoLength, func(i int) bool { return nodesInfo[i].Count < need })
	if p == nodesInfoLength {
		return nil, types.ErrAlreadyFilled
	}
	nodesInfo = nodesInfo[p:]
	if limit > 0 && len(nodesInfo) > limit {
		nodesInfo = nodesInfo[:limit]
	}
	for i := range nodesInfo {
		diff := need - nodesInfo[i].Count
		if nodesInfo[i].Capacity < diff {
			return nil, types.NewDetailedErr(types.ErrInsufficientRes,
				fmt.Sprintf("node %s cannot alloc a fill node plan", nodesInfo[i].Name))
		}
		nodesInfo[i].Deploy = diff
		nodesInfo[i].Capacity -= diff
	}
	log.Debugf("[FillPlan] nodesInfo: %v", nodesInfo)
	return nodesInfo, nil
}
1184393
func (s *set) Add(vs ...interface{}) {
	for _, v := range vs {
		s.values[v] = struct{}{}
	}
}
1110680
func Fill(element interface{}, node *Node) error {
	if element == nil || node == nil {
		return nil
	}

	if node.Kind == 0 {
		return fmt.Errorf("missing node type: %s", node.Name)
	}

	elem := reflect.ValueOf(element)
	if elem.Kind() == reflect.Struct {
		return fmt.Errorf("struct are not supported, use pointer instead")
	}

	return fill(elem.Elem(), node)
}
410115
func inputsToEmpties(arr []Input) []interface{} {
	ret := make([]interface{}, len(arr))
	for i, in := range arr {
		ret[i] = in
	}
	return ret
}
169968
func (s Int64) Insert(items ...int64) {
	for _, item := range items {
		s[item] = Empty{}
	}
}
82747
func (self *Form) Input(name, value string) *Form {
	if _, ok := self.fields[name]; ok {
		self.fields.Set(name, value)
	}
	return self
}
977995
func fillWithRepeats(pattern []byte, v int) []byte {
	if len(pattern) == 0 {
		return nil
	}
	outputLen := v * ((len(pattern) + v - 1) / v)
	return bytes.Repeat(pattern, (outputLen+len(pattern)-1)/len(pattern))[:outputLen]
}