def _check_uniqueness_of_entries(data_set, data_set_name=None, raise_exception=True):
    """
    Check if all entries in iterable are unique in iterable

    Parameters
    ----------
    data_set : [list, set]
        iterable containing the entries to test for uniqueness
    data_set_name : str, optional
        the name of the data_set for displaying in exception
    raise_exception : bool, optional
        if raising an exception or returning `False` on non-uniqueness

    """
    if len(set(data_set)) != len(data_set):
        entries = set()
        doubles = set()

        for entry in data_set:
            if entry in entries:
                doubles.add(entry)
            entries.add(entry)
        if data_set_name:
            error_message = f"following {len(doubles)} entries of {data_set_name} are not unique: {doubles}"
        else:
            error_message = f"following {len(doubles)} entries are not unique in provided data: {doubles}"

        if raise_exception:
            raise ValueError(error_message)
        else:
            return False
    return True