def merge_junctions(junction_sets):
    """
    Merge the given set of junctions and return
    the union

    @param junction_sets: list of list of junctions
    @type junction_sets: list
    @return: merged junctions
    @rtype: set
    """
    s = set([])
    for js in junction_sets:
        if s is None:
            s = set(js)
        else:
            s = s.union(js)
    return s