from itertools import chain


def get_words(words):
    """Splits out a parameter set into individual words.

    First, it splits the input parameters by space.  Then, it chains them
    together.  Then, it joins them together delimited by , and splits them
    out once again.  The end result is that words can be provided as
    individual parameters, or a single comma separated string or a single
    space separated string or some combination thereof.

    Args:
        words: The word list to split out
    Returns:
        A set (hash set) of words which were in the provided input
    """
    # First, convert all arguments to strings
    words = [i if isinstance(i, str) else (','.join(i) if hasattr(i, '__iter__')
                                           else str(i))
             for i in words]
    # Split on spaces, then chain the resulting arrays together
    # Join into a single string delimited by comma
    words = ','.join(chain.from_iterable(i.split() for i in words))
    # Split out the joined string by comma (to also split any single words which
    # contained a comma).  Ignore empty strings.
    return set(i for i in words.split(',') if i)