def get_targets(test_set):
    """
    Get set of elements in index position 0 and 1 from each tuple from list.
    :param test_set: list of tuples, each tuple a test item
    :return union: set, union of targets in index position 0 and 1
    """
    
    xs, ys, labels, relation = zip(*test_set)
    union = set(xs) | set(ys)
    return union