class_docstr: A metaclass used to auto-fill union classes for FBLearner.
  It automatically keeps track of all the subclasses and uses them to fill the union
      class (by calling the fill_union() method).
  After a union class is filled, the registry gets frozen and new members can't be added.
  If environment variable SKIP_FROZEN_REGISTRY_CHECK=1 is set, we log a warning instead of
      raising an exception when a new member is attempted to be added to the registry.
code: def fill_union(cls):
      def wrapper(union):
          cls.REGISTRY_FROZEN = True
  
          def make_union_instance(inst, instance_class=None):
              inst_class = instance_class or type(inst)
              key = getattr(
                  inst_class, "__registry_name__", inst_class.__name__
              )
              return union(**{key: inst})
  
          union.make_union_instance = make_union_instance
  
          if not IS_FB_ENVIRONMENT:
              # OSS TaggedUnion
              union.__annotations__ = {
                  name: Optional[t] for name, t in cls.REGISTRY.items()
              }
              for name in cls.REGISTRY:
                  setattr(union, name, None)
              return dataclass(frozen=True)(union)
          else:
              # FBL TaggedUnion
              union.__annotations__ = {
                  name: t for name, t in cls.REGISTRY.items()
              }
              return union
  
      return wrapper
  
file_path: ReAgent/reagent/core/registry_meta.py
imports: import abc
  import logging
  import os
  from typing import Dict, Optional, Type
  from reagent.core.dataclasses import dataclass
  from reagent.core.fb_checker import IS_FB_ENVIRONMENT
label_desc: Use image node_id 2 for calling the RegistryMeta obj's underlying member method code with example usage: obj.fill_union(cls) and returns: wrapper, union, dataclass, union