// Combine takes a list of TransformFuncs and converts them
// into a single transform function applying all functions one by one
176827
func Combine(funcs ...TransformFunc) TransformFunc {
	return func(parents *NodeList, in xml.Token) []xml.Token {
		out := []xml.Token{in}
		for _, f := range funcs {
			new := []xml.Token{}
			for _, t := range out {
				new = append(new, f(parents, t)...)
			}
			out = new
		}
		return out
	}
}
246988
func (g *Gauge) Combine(other []byte) error {
	var otherValue float64
	buf := bytes.NewReader(other)
	err := binary.Read(buf, binary.LittleEndian, &otherValue)

	if err != nil {
		return err
	}

	g.value = otherValue

	return nil
}
173825
func (r Result) CombinedOutput() string {
	strs := []string{}
	if sout := r.Stdout.String(); sout != "" {
		strs = append(strs, fmt.Sprintf("[stdout]: %s", sout))
	}
	if serr := r.Stderr.String(); serr != "" {
		strs = append(strs, fmt.Sprintf("[stderr]: %s", serr))
	}
	return strings.Join(strs, ", ")
}
911216
func merge(envs ...map[string]string) map[string]string {
	merged := make(map[string]string)
	for _, env := range envs {
		for k, v := range env {
			merged[k] = v
		}
	}
	return merged
}
1176805
func Merge(values ...Value) (Value, error) {
	var args []string
	for _, value := range values {
		args = append(args, value.String())
	}
	return Parse(args...)
}
1140643
func (result ErrorResults) Combine() error {
	var errorStrings []string
	for _, r := range result.Results {
		if r.Error != nil {
			errorStrings = append(errorStrings, r.Error.Error())
		}
	}
	if errorStrings != nil {
		return errors.New(strings.Join(errorStrings, "\n"))
	}
	return nil
}
279806
func (t Any) Merge(other Type) Any {
	if otherAny, ok := other.(Any); ok {
		return t.Union(otherAny)
	}
	if t.Contains(other) {
		return t
	}
	return append(t, other)
}
128571
func (s *apbqBinarySplitState) combine(ctx decimal.Context, L, R *apbqBinarySplitState) {
	// T = L.B*L.P*R.T, t1 = R.B*R.Q*L.T
	t0 := alias(alias(s.T, L.T), R.T)
	ctx.Mul(t0, L.B, L.P)
	ctx.Mul(t0, t0, R.T)

	t1 := alias(alias(s.B, L.B), R.B) // clobber s.B, if possible.
	ctx.Mul(t1, R.B, R.Q)
	ctx.FMA(s.T, t1, L.T, t0) // combine the final multiply and t0 + t1

	ctx.Mul(s.B, L.B, R.B)
	ctx.Mul(s.P, L.P, R.P)
	ctx.Mul(s.Q, L.Q, R.Q)
}
496128
func (r Region) Combine(r2 Region) Region {
	return Region{Min(r.From, r2.From), Max(r.To, r2.To), r.Dir}
}
380240
func merge(c1 *fab.ChaincodeCall, c2 *fab.ChaincodeCall) (*fab.ChaincodeCall, bool) {
	c := &fab.ChaincodeCall{ID: c1.ID, Collections: c1.Collections}
	merged := false
	for _, coll := range c2.Collections {
		if !contains(c.Collections, coll) {
			c.Collections = append(c.Collections, coll)
			merged = true
		}
	}
	return c, merged
}
336570
func (s *Set) Combine(other []byte) error {
	otherHLL := hyperloglog.New()
	if err := otherHLL.UnmarshalBinary(other); err != nil {
		return err
	}
	if err := s.Hll.Merge(otherHLL); err != nil {
		// does not error unless compressions are different
		// however, decoding the other Hll causes us to use its compression
		// parameter, which might be different from ours
		return err
	}
	return nil
}
838441
func Merge(labels1, labels2 Set) Set {
	mergedMap := Set{}

	for k, v := range labels1 {
		mergedMap[k] = v
	}
	for k, v := range labels2 {
		mergedMap[k] = v
	}
	return mergedMap
}
1134615
func Merge(fromMap, ToMap interface{}) interface{} {
	switch fromMap := fromMap.(type) {
	case map[string]interface{}:
		ToMap, ok := ToMap.(map[string]interface{})
		if !ok {
			return fromMap
		}
		for keyToMap, valueToMap := range ToMap {
			if valueFromMap, ok := fromMap[keyToMap]; ok {
				fromMap[keyToMap] = Merge(valueFromMap, valueToMap)
			} else {
				fromMap[keyToMap] = valueToMap
			}
		}
	case nil:
		// merge(nil, map[string]interface{...}) -> map[string]interface{...}
		ToMap, ok := ToMap.(map[string]interface{})
		if ok {
			return ToMap
		}
	}
	return fromMap
}
824296
func (c *Corpus) Merge(other *Corpus) {
	for i, word := range other.words {
		freq := other.frequencies[i]
		if id, ok := c.ids[word]; ok {
			c.frequencies[id] += freq
			c.totalFreq += freq
		} else {
			id := c.Add(word)
			c.frequencies[id] += freq - 1
			c.totalFreq += freq - 1
		}
	}
}
927765
func (s Set) Merge(set Set) {
	for t, v := range set {
		if v {
			s[t] = true
		}
	}
}
721991
func (s *Set) Merge(v *metricpb.SetValue) error {
	return s.Combine(v.HyperLogLog)
}
958126
func (c *Counter) Combine(other []byte) error {
	var otherCounts int64
	buf := bytes.NewReader(other)
	err := binary.Read(buf, binary.LittleEndian, &otherCounts)

	if err != nil {
		return err
	}

	c.value += otherCounts

	return nil
}