Joins two sets into a single new set.
        label_a, label_b can be any nodes within the sets
557720
def union(self, label_a, label_b):
        
        # Base case to avoid work
        if label_a == label_b:
            return

        # Find the tree root of each node
        root_a = self.find(label_a)
        root_b = self.find(label_b)

        # Avoid merging a tree to itself
        if root_a == root_b:
            return

        self.__internal_union(root_a, root_b)
        self.__set_counter -= 1
325073
def union(self, key, *others):
        """"""
        if not isinstance(key, str):
            raise ValueError("String expected.")
        self.db.sunionstore(key, [self.key] + [o.key for o in others])
        return Set(key)
55371
public static <E> Set<E> unionView(final Set<? extends E> set1, final Set<? extends E> set2) {
		return Sets.union(set1, set2);
	}
362243
public static <T> Set<T> intersection(Set<T> setA, Set<T> setB) {
        Set<T> intersection = new HashSet<T>(setA);
        intersection.retainAll(setB);
        return intersection;
    }
629198
def dict_merge(set1, set2):
    """"""
    return dict(list(set1.items()) + list(set2.items()))
1176880
def join(self, featuresets):
        """"""
        concepts = (f.concept for f in featuresets)
        join = self.lattice.join(concepts)
        return self._featuresets[join.index]
1238326
def add_to_set(original_set, element):
    """"""
    if not element:
        return original_set
    if isinstance(element, Set):
        original_set |= element
    elif isinstance(element, (list, tuple)):
        original_set |= set(element)
    else:
        original_set.add(element)
    return original_set
190052
def join(self, t2, unique=False):
        

        x_v1 = np.concatenate((self.x, t2.x), axis=0)
        y_v1 = np.concatenate((self.y, t2.y), axis=0)

        ## remove any duplicates

        if not unique:
            a = np.ascontiguousarray(np.vstack((x_v1, y_v1)).T)
            unique_a = np.unique(a.view([('', a.dtype)]*a.shape[1]))
            unique_coords = unique_a.view(a.dtype).reshape((unique_a.shape[0], a.shape[1]))

            x_v1 = unique_coords[:,0]
            y_v1 = unique_coords[:,1]

        return x_v1, y_v1
850625
def create_from_tuples(self, tuples, **args):
        
        amap = {}
        subject_label_map = {}
        for a in tuples:
            subj = a[0]
            subject_label_map[subj] = a[1]
            if subj not in amap:
                amap[subj] = []
            amap[subj].append(a[2])

        aset = AssociationSet(subject_label_map=subject_label_map, association_map=amap, **args)
        return aset
825781
function mk_NodeSet(k_graph, a_terms, s_term_types) {
	// prep to reduce nodes to a set
	let h_nodes = {};

	// nodes are all NamedNodes
	if('NamedNode' === s_term_types) {
		for(let i_term=0; i_term<a_terms.length; i_term++) {
			let h_term = a_terms[i_term];
			h_nodes[h_term.value] = h_term;
		}
	}
	// nodes are all BlankNodes
	else if('BlankNodes' === s_term_types) {
		for(let i_term=0; i_term<a_terms.length; i_term++) {
			let h_term = a_terms[i_term];
			h_nodes['_:'+h_term.value] = h_term;
		}
	}
	// nodes are mixed
	else {
		for(let i_term=0; i_term<a_terms.length; i_term++) {
			let h_term = a_terms[i_term];
			h_nodes[h_term.isBlankNode? '_:'+h_term.value: h_term.value] = h_term;
		}
	}

	// reduce nodes to a set
	let as_nodes = [];
	for(let s_node_id in h_nodes) {
		let k_node = k_graph.nodes[s_node_id]
			|| k_graph.leafs[s_node_id]
			|| (k_graph.leafs[s_node_id] = new Node(k_graph, [], h_nodes[s_node_id]));

		// only add subject nodes that exist to the set
		if(k_node) as_nodes.push(k_node);
	}

	// make instance
	let h_methods = Object.assign(Object.create(NodeSet_prototype), {
		graph: k_graph,
		nodes: as_nodes,

		areNodes: true,
	});

	// construct 'that'
	let f_bound = NodeSet_operator.bind(h_methods);

	// save to list so we can reuse it
	a_terms.set = f_bound;

	// make & return operator
	Object.setPrototypeOf(f_bound, NodeSet_prototype);
	return Object.assign(f_bound, h_methods);
}
694041
public static MaybeAssignedSet join(MaybeAssignedSet left, MaybeAssignedSet right) {
		if (left == null && right == null) {
			return null;
		} else if (left == null) {
			return right;
		} else if (right == null) {
			return left;
		} else {
			return left.join(right);
		}
	}
387140
private void associate( int a, int b, int[] labels ) {

        if (a > b) {
            associate(b, a, labels);
            return;
        }
        if ((a == b) || (labels[b] == a))
            return;
        if (labels[b] == b) {
            labels[b] = a;
        } else {
            associate(labels[b], a, labels);
            if (labels[b] > a) { // ***rbf new
                labels[b] = a;
            }
        }
    }
62017
private MultiValueMap<String, String> union(MultiValueMap<String, String> map1, MultiValueMap<String, String> map2) {
		MultiValueMap<String, String> union = new LinkedMultiValueMap<String, String>(map1);
		Set<Entry<String, List<String>>> map2Entries = map2.entrySet();
		for (Iterator<Entry<String, List<String>>> entryIt = map2Entries.iterator(); entryIt.hasNext();) {
			Entry<String, List<String>> entry = entryIt.next();
			String key = entry.getKey();
			List<String> values = entry.getValue();
			for (String value : values) {
				union.add(key, value);
			}
		}
		return union;
	}
494050
def join_cols(cols):
    """"""
    return ", ".join([i for i in cols]) if isinstance(cols, (list, tuple, set)) else cols
1051360
public static <E> Set<E> intersection(Set<E> s1, Set<E> s2) {
    Set<E> s = new HashSet<E>();
    s.addAll(s1);
    s.retainAll(s2);
    return s;
  }
20179
def union(a: Iterable[Any], b: Iterable[Any]) -> List[Any]:
    
    u = []  # type: List[Any]
    for item in a:
        if item not in u:
            u.append(item)
    for item in b:
        if item not in u:
            u.append(item)
    return u
179446
def merge_nodes(self, n1: str, n2: str, same_polarity: bool = True):
        

        for p in self.predecessors(n1):
            for st in self[p][n1]["InfluenceStatements"]:
                if not same_polarity:
                    st.obj_delta["polarity"] = -st.obj_delta["polarity"]
                st.obj.db_refs["UN"][0] = (n2, st.obj.db_refs["UN"][0][1])

            if not self.has_edge(p, n2):
                self.add_edge(p, n2)
                self[p][n2]["InfluenceStatements"] = self[p][n1][
                    "InfluenceStatements"
                ]

            else:
                self[p][n2]["InfluenceStatements"] += self[p][n1][
                    "InfluenceStatements"
                ]

        for s in self.successors(n1):
            for st in self.edges[n1, s]["InfluenceStatements"]:
                if not same_polarity:
                    st.subj_delta["polarity"] = -st.subj_delta["polarity"]
                st.subj.db_refs["UN"][0] = (n2, st.subj.db_refs["UN"][0][1])

            if not self.has_edge(n2, s):
                self.add_edge(n2, s)
                self[n2][s]["InfluenceStatements"] = self[n1][s][
                    "InfluenceStatements"
                ]
            else:
                self[n2][s]["InfluenceStatements"] += self[n1][s][
                    "InfluenceStatements"
                ]

        self.remove_node(n1)