def getCombineSet(listDict, names):
    """
    Calculate the union of a dict of lists.

    Parameters
    ----------
    listDict : dict of list of any
        The dict of lists to be combined.
    names : list of str
        The keys of lists to be combined.

    Returns
    -------
    list of any
        The union of lists in listDict whose key is in names.
    """
    res = []
    for name in names:
        assert (name in listDict), 'Error: name asked {} does not exist in listDict with keys {}.'.format(name, list(listDict.keys()))
        res = res + listDict[name]
    return set(res)