code: def create(cls, **kwargs):
      assert len(kwargs) == 1
      obj = cls(**{**{f.name: None for f in fields(cls)}, **kwargs})  # type: ignore[arg-type]
      obj._type = _UnionTag.create(next(iter(kwargs.keys())), cls)
      return obj
  
file_path: pytorch/torch/_export/serde/union.py
imports: import functools
  from dataclasses import fields
  from typing import Hashable, Set
label_desc: Use image node_id 1 for calling the _Union obj's underlying member method code with example usage: obj.create(cls) and returns: obj