def str_to_set(text):
    """
    transforms comma separated string into a set
    'name1, name2, name3' -> {'name1', 'name2', 'name3'}
    """
    if isinstance(text, str):
        return frozenset([name.strip() for name in text.split(',')])
    elif isinstance(text, set) or isinstance(text, frozenset): # if its already a set, return it (might happen!)
        return text
    else:
        raise Exception(f'the input "{text}" was supposed to be a string (or maybe a set), introduced to function set_to_str')