import re


def _normalize_value(list):
    """Convert a given list.
    All elements will be converted to lower case and the list will be
    returned as a set. If the element contains a comma separated string,
    it will be split into a list first."""
    normalized = []
    for item in list:
        normalized.append(item.lower())
    if len(normalized) == 1 and re.match(r".*,.*",normalized[0]):
        value_as_set = set(normalized[0].split(','))
    else:
        value_as_set = set(normalized)
    return value_as_set