code: def __getattribute__(self, name):
      attr = super().__getattribute__(name)
      if attr is None and name in _get_field_names(type(self)) and name != self.type:  # type: ignore[arg-type]
          raise AttributeError(f"Field {name} is not set.")
      return attr
  
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 5 for calling the _Union obj's underlying member method code with example usage: obj.__getattribute__(name) and returns: attr