def merge_lines(line_sets, merge_fun=set.union, sort=True):
    """
    Merge the contents of a list of sets of strings.

    :param line_sets: A list of sets of strings.
    :param merge_fun: A callable that merges sets
    :param sort: Sort the resulting merged entries.
    :return:
    """
    merged_lines = merge_fun(*line_sets)

    if sort:
        return tuple(sorted(merged_lines))
    else:
        return tuple(merged_lines)