def METHOD_NAME(tag_value):
    """
    Validate a tag value, make sure it is of correct type.
    Return a tag dict for internal representation.
    Sample input / output:
    'foo' -> {'simple': {'foo'}
    ('foo', 'bar') -> {'simple': {'foo', 'bar'}
    {'color': 'red'} -> {'color': {'red'}
    {'color': ('red', 'blue')} -> {'color': {'red', 'blue'}
    :param tag_value: User defined tag value.
    :type tag_value: ``string``, ``iterable`` of ``string`` or
                     a ``dict`` with ``string`` keys
                     and ``string`` or ``iterable`` of ``string`` as values.
    :return: Internal representation of the tag context.
    :rtype: ``dict`` of ``set``
    """
    def validate_value(value):
        """Make sure tag value is either a string or an iterable of strings."""
        if isinstance(value, str):
            return {_validate_tag_value_string(value)}
        elif isinstance(value, collections.abc.Iterable):
            return {_validate_tag_value_string(tag) for tag in value}
        raise ValueError(
            (
                'Invalid tag value: "{}", only strings, an iterable'
                " of strings or dictionaries are allowed.".format(value)
            )
        )
    if isinstance(tag_value, dict):
        return {
            _validate_tag_name_string(k): validate_value(v)
            for k, v in tag_value.items()
        }
    return {SIMPLE: validate_value(tag_value)}