code: def extract_name(union_type):
      name_dict = {}
      for t in union_type.__args__:
          type_ = t.__fields__["name"].type_
          name = get_literal_value(type_)
          name_dict[name] = name
      return enum.Enum("Choice", name_dict)
  
file_path: dgl/dglgo/dglgo/utils/base_model.py
imports: import copy
  import enum
  from enum import Enum, IntEnum
  from typing import Optional
  from jinja2 import Template
  from pydantic import BaseModel, create_model, create_model, Field
label_desc: Use image node_id 2 for calling a global function with example usage: extract_name(union_type) and returns: enum