@lru_cache()<EOL>def is_union_type(type_):
if is_typing_type(type_) and hasattr(type_, "<STR_LIT>"):<EOL><INDENT>return type_.__origin__ in _get_types(Types.UNION)<EOL><DEDENT>return False<EOL>
Checks if the given type is a union type.

    :param type_: The type to check
    :return: True if the type is a union type, otherwise False
    :rtype: bool