// Union returns the graph union g1 ∪ g2, which
// consists of the union of the two vertex sets
// and the union of the two edge sets of g1 and g2.
// The edges of the new graph will have zero cost.
433842
func (g1 *Virtual) Union(g2 *Virtual) *Virtual {
	return g1.union(g2, false)
}
203314
func (s1 String) Union(s2 String) String {
	result := NewString()
	for key := range s1 {
		result.Insert(key)
	}
	for key := range s2 {
		result.Insert(key)
	}
	return result
}
454460
func (s *Set) Union(other *Set) *Set {
	result := &Set{F: s.F}
	result.once.Do(result.init)

	for k, v := range s.m {
		result.m[k] = v
	}
	for k, v := range other.m {
		result.m[k] = v
	}

	return result
}
1267488
func (m *IntSet) Union(a int, b int) {
	m.parent[m.FindRoot(a)] = m.FindRoot(b)
}
1341627
func (dst *Region) Union(other *Region) error {
	ret := Status(C.cairo_region_union(dst.Ptr, other.Ptr)).toError()
	if err := dst.status(); err != nil {
		panic(err)
	}
	return ret
}
111277
func (s *Set) Union(t *Set) *Set {
	// Clone the current set into a new set
	outSet := s.Clone()

	// Enumerate and add all elements from the parameter set
	for _, e := range t.Enumerate() {
		outSet.Add(e)
	}

	return outSet
}
1117208
func (t Type) Union() ([]string, bool) {
	if !t.IsUnion() {
		return nil, false
	}
	tips := []string{}
	for _, ut := range strings.Split(t.TypeString(), "|") {
		tips = append(tips, strings.TrimSpace(ut))
	}
	return tips, true
}
274710
func (t Any) Union(other Any) Any {
	if len(t) == 0 {
		return t
	}
	if len(other) == 0 {
		return other
	}
	cpy := make(Any, len(t))
	for i := range cpy {
		cpy[i] = t[i]
	}
	for i := range other {
		if !cpy.Contains(other[i]) {
			cpy = append(cpy, other[i])
		}
	}
	return cpy
}
990146
func (b *Bitmap) Union(others ...*Bitmap) *Bitmap {
	if len(others) == 1 {
		output := NewBitmap()
		b.unionIntoTargetSingle(output, others[0])
		return output
	}
	output := b.Clone()
	output.UnionInPlace(others...)
	return output
}
48032
func Merge(coll1, coll2 []string) []string {
	m := map[string]struct{}{}
	for _, v := range append(coll1, coll2...) {
		m[v] = struct{}{}
	}
	r := make([]string, 0, len(m))
	for k := range m {
		r = append(r, k)
	}
	return r
}
243527
func Union(a, b interface{}) interface{} {
	chk := ty.Check(
		new(func(map[ty.A]bool, map[ty.A]bool) map[ty.A]bool),
		a, b)
	va, vb, tc := chk.Args[0], chk.Args[1], chk.Returns[0]

	vtrue := reflect.ValueOf(true)
	vc := reflect.MakeMap(tc)
	for _, vkey := range va.MapKeys() {
		vc.SetMapIndex(vkey, vtrue)
	}
	for _, vkey := range vb.MapKeys() {
		vc.SetMapIndex(vkey, vtrue)
	}
	return vc.Interface()
}
384686
public Graph<K, VV, EV> union(Graph<K, VV, EV> graph) {
		DataSet<Vertex<K, VV>> unionedVertices = graph
			.getVertices()
			.union(this.getVertices())
				.name("Vertices")
			.distinct()
				.name("Vertices");

		DataSet<Edge<K, EV>> unionedEdges = graph
			.getEdges()
			.union(this.getEdges())
				.name("Edges");

		return new Graph<>(unionedVertices, unionedEdges, this.context);
	}
936742
func UnionAll(builder ...Builder) interface {
	Builder
	As(string) Builder
} {
	return &union{
		builder: builder,
		all:     true,
	}
}
627874
func (s1 Byte) Union(s2 Byte) Byte {
	result := NewByte()
	for key := range s1 {
		result.Insert(key)
	}
	for key := range s2 {
		result.Insert(key)
	}
	return result
}
780612
func UnionWithOpts(optArgs UnionOpts, args ...interface{}) Term {
	return constructRootTerm("Union", p.Term_UNION, args, optArgs.toMap())
}
1089313
func (term Range) Union(other Range) (union Range) {
	if term.IsEmpty() && other.IsEmpty() {
		union = Empty()
		return
	}
	if !term.IsEmpty() && term.Start.IsZero() {
		// Unbounded
	} else if !other.IsEmpty() && other.Start.IsZero() {
		// Unbounded
	} else if term.Start.Before(other.Start) {
		union.Start = term.Start
	} else {
		union.Start = other.Start
	}
	if !term.IsEmpty() && term.End.IsZero() {
		// Unbounded
	} else if !other.IsEmpty() && other.End.IsZero() {
		// Unbounded
	} else if term.End.After(other.End) {
		union.End = term.End
	} else {
		union.End = other.End
	}
	return
}
1239940
func (s *Set) Union(t *Set) *Set {
	ls, lt := len(s.items), len(t.items)
	if lt < ls {
		s, t = t, s
	}

	res := t.Clone()
	for _, v := range s.items {
		res.Add(v)
	}
	return res
}