def _get_enum_type_from_union_of_literals(typ: UnionType) -> MypyType:
    """
    Attempts to resolve a single enum type from a union of enum literals.

    If this cannot be resolved, the original is returned.
    """
    types = set()

    for item in typ.items:
        item = get_proper_type(item)
        if not isinstance(item, LiteralType) or not item.fallback.type.is_enum:
            # If anything that isn't a literal of an enum type is encountered, return the original.
            return typ
        types.add(item.fallback)

    # If there is only one enum type seen, return that otherwise return the original.
    return types.pop() if len(types) == 1 else typ

    Attempts to resolve a single enum type from a union of enum literals.

    If this cannot be resolved, the original is returned.
    
mypy_django_plugin/transformers/choices.py