// Concat returns the concatenation of its arguments. It does not
// modify its inputs.
970009
func Concat(xss ...[]float64) []float64 {
	total := 0
	for _, xs := range xss {
		total += len(xs)
	}
	out := make([]float64, total)
	pos := 0
	for _, xs := range xss {
		pos += copy(out[pos:], xs)
	}
	return out
}
1013774
func (v Values) Add(key, value string) {
	v[key] = append(v[key], value)
}
316697
func concatAndGetBytes(arr []string, delim string) []byte {
	cstr := ""
	for _, s := range arr {
		cstr += s
		cstr += delim
	}
	return []byte(cstr)
}
108595
func (tb *LTable) Append(value LValue) {
	if value == LNil {
		return
	}
	if tb.array == nil {
		tb.array = make([]LValue, 0, defaultArrayCap)
	}
	tb.array = append(tb.array, value)
}
1298395
func concatenateN(l []*Automaton) *Automaton {
	ans := newEmptyAutomaton()

	// first pass: create all states
	for _, a := range l {
		if a.numStates() == 0 {
			ans.finishState()
			return ans
		}
		numStates := a.numStates()
		for s := 0; s < numStates; s++ {
			ans.createState()
		}
	}

	// second pass: add transitions, carefully linking accept
	// states of A to init state of next A:
	stateOffset := 0
	t := newTransition()
	for i, a := range l {
		numStates := a.numStates()

		var nextA *Automaton
		if i < len(l)-1 {
			nextA = l[i+1]
		}

		for s := 0; s < numStates; s++ {
			numTransitions := a.initTransition(s, t)
			for j := 0; j < numTransitions; j++ {
				a.nextTransition(t)
				ans.addTransitionRange(stateOffset+s, stateOffset+t.dest, t.min, t.max)
			}

			if a.IsAccept(s) {
				followA := nextA
				followOffset := stateOffset
				upto := i + 1
				for {
					if followA != nil {
						// adds a "virtual" epsilon transition:
						numTransitions = followA.initTransition(0, t)
						for j := 0; j < numTransitions; j++ {
							followA.nextTransition(t)
							ans.addTransitionRange(stateOffset+s, followOffset+numStates+t.dest, t.min, t.max)
						}
						if followA.IsAccept(0) {
							// keep chaning if followA accepts empty string
							followOffset += followA.numStates()
							if upto < len(l)-1 {
								followA = l[upto+1]
							} else {
								followA = nil
							}
							upto++
						} else {
							break
						}
					} else {
						ans.setAccept(stateOffset+s, true)
						break
					}
				}
			}
		}

		stateOffset += numStates
	}

	if ans.numStates() == 0 {
		ans.createState()
	}

	ans.finishState()
	return ans
}
987456
func (s *SigningOpts) Append(x int) {
	s.Indices = append(s.Indices, x)
}
702965
function concat() {
  const args = Array.from(arguments).filter(e => e != null);
  const baseArray = Array.isArray(args[0]) ? args[0] : [args[0]];
  return Array.prototype.concat.apply(baseArray, args.slice(1));
}
450708
func encodeGRPCConcatResponse(_ context.Context, response interface{}) (interface{}, error) {
	resp := response.(addendpoint.ConcatResponse)
	return &pb.ConcatReply{V: resp.V, Err: err2str(resp.Err)}, nil
}
392288
func (s Constraints) Append(other Constraints) Constraints {
	raw := make(version.Constraints, 0, len(s.raw)+len(other.raw))

	// Since "raw" is a list of constraints that remove versions from the set,
	// "Intersection" is implemented by concatenating together those lists,
	// thus leaving behind only the versions not removed by either list.
	raw = append(raw, s.raw...)
	raw = append(raw, other.raw...)

	// while the set is unordered, we sort these lexically for consistent output
	sort.Slice(raw, func(i, j int) bool {
		return raw[i].String() < raw[j].String()
	})

	return Constraints{raw}
}
931243
func interpolationFuncConcat() ast.Function {
	return ast.Function{
		ArgTypes:     []ast.Type{ast.TypeList},
		ReturnType:   ast.TypeList,
		Variadic:     true,
		VariadicType: ast.TypeList,
		Callback: func(args []interface{}) (interface{}, error) {
			var outputList []ast.Variable

			for _, arg := range args {
				for _, v := range arg.([]ast.Variable) {
					switch v.Type {
					case ast.TypeString:
						outputList = append(outputList, v)
					case ast.TypeList:
						outputList = append(outputList, v)
					case ast.TypeMap:
						outputList = append(outputList, v)
					default:
						return nil, fmt.Errorf("concat() does not support lists of %s", v.Type.Printable())
					}
				}
			}

			// we don't support heterogeneous types, so make sure all types match the first
			if len(outputList) > 0 {
				firstType := outputList[0].Type
				for _, v := range outputList[1:] {
					if v.Type != firstType {
						return nil, fmt.Errorf("unexpected %s in list of %s", v.Type.Printable(), firstType.Printable())
					}
				}
			}

			return outputList, nil
		},
	}
}
190093
func ConcatStrings(src []string, prefix string, postfix string) []string {
	var buf bytes.Buffer
	ret := make([]string, len(src))
	for i, s := range src {
		buf.WriteString(prefix)
		buf.WriteString(s)
		buf.WriteString(postfix)
		ret[i] = buf.String()
		buf.Reset()
	}
	return ret
}
1331810
func (p *qProp) combine(q qProp) {
	switch {
	case p.err != nil:
		// Do nothing
	case q.err != nil:
		p.err = q.err
	default:
		p.isAggregation = p.isAggregation || q.isAggregation
		p.isRowFunc = p.isRowFunc || q.isRowFunc
		if p.isAggregation && p.isRowFunc {
			p.err = errNestedAggregation
		}
	}
}
834100
func concatRows(tabs ...*Table) *Table {
	// TODO: Consider making this public. It would have to check
	// the columns, and we would probably also want a concatCols.

	switch len(tabs) {
	case 0:
		return new(Table)

	case 1:
		return tabs[0]
	}

	// Construct each column.
	var out Builder
	seqs := make([]slice.T, len(tabs))
	for _, col := range tabs[0].Columns() {
		seqs = seqs[:0]
		for _, tab := range tabs {
			seqs = append(seqs, tab.Column(col))
		}
		out.Add(col, slice.Concat(seqs...))
	}

	return out.Done()
}
1024776
func ConcatJSON(blobs ...[]byte) []byte {
	if len(blobs) == 0 {
		return nil
	}

	last := len(blobs) - 1
	for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) {
		// strips trailing null objects
		last = last - 1
		if last < 0 {
			// there was nothing but "null"s or nil...
			return nil
		}
	}
	if last == 0 {
		return blobs[0]
	}

	var opening, closing byte
	var idx, a int
	buf := bytes.NewBuffer(nil)

	for i, b := range blobs[:last+1] {
		if b == nil || bytes.Equal(b, nullJSON) {
			// a null object is in the list: skip it
			continue
		}
		if len(b) > 0 && opening == 0 { // is this an array or an object?
			opening, closing = b[0], closers[b[0]]
		}

		if opening != '{' && opening != '[' {
			continue // don't know how to concatenate non container objects
		}

		if len(b) < 3 { // yep empty but also the last one, so closing this thing
			if i == last && a > 0 {
				if err := buf.WriteByte(closing); err != nil {
					log.Println(err)
				}
			}
			continue
		}

		idx = 0
		if a > 0 { // we need to join with a comma for everything beyond the first non-empty item
			if err := buf.WriteByte(comma); err != nil {
				log.Println(err)
			}
			idx = 1 // this is not the first or the last so we want to drop the leading bracket
		}

		if i != last { // not the last one, strip brackets
			if _, err := buf.Write(b[idx : len(b)-1]); err != nil {
				log.Println(err)
			}
		} else { // last one, strip only the leading bracket
			if _, err := buf.Write(b[idx:]); err != nil {
				log.Println(err)
			}
		}
		a++
	}
	// somehow it ended up being empty, so provide a default value
	if buf.Len() == 0 {
		if err := buf.WriteByte(opening); err != nil {
			log.Println(err)
		}
		if err := buf.WriteByte(closing); err != nil {
			log.Println(err)
		}
	}
	return buf.Bytes()
}
1229787
function concat () {
  var items = R.dropLast(1, arguments);

  if (!items.length) {
    throw new Error('The helper "concat" must be passed at least one argument.');
  }

  return items.join('');
}
5964
func ConcatString(n *ast.BinaryExpr) (string, bool) {
	var s string
	// sub expressions are found in X object, Y object is always last BasicLit
	if rightOperand, ok := n.Y.(*ast.BasicLit); ok {
		if str, err := GetString(rightOperand); err == nil {
			s = str + s
		}
	} else {
		return "", false
	}
	if leftOperand, ok := n.X.(*ast.BinaryExpr); ok {
		if recursion, ok := ConcatString(leftOperand); ok {
			s = recursion + s
		}
	} else if leftOperand, ok := n.X.(*ast.BasicLit); ok {
		if str, err := GetString(leftOperand); err == nil {
			s = str + s
		}
	} else {
		return "", false
	}
	return s, true
}
502205
func (d *Context) Concat(count int) {
	C.duk_concat(d.duk_context, C.duk_idx_t(count))
}