code: def build_subclass_dict(subclasses):
      subclasses_dict = {}
      for subclass in subclasses:
          if type(None) != subclass:
              if getattr(subclass, "__EXPANSIBLE__", False):
                  children = Registry.subconfigs(subclass)
                  for child in children:
                      subclasses_dict[
                          _canonical_typename(child).lower()
                      ] = child
              else:
                  subclasses_dict[
                      _canonical_typename(subclass).lower()
                  ] = subclass
      return subclasses_dict
  
imports: from enum import Enum
  from typing import Any, Dict, List, Tuple, Type, Union
  from pytext.common.utils import eprint
  from .component import Registry
  from .config_adapter import upgrade_to_latest
  from .pytext_config import PyTextConfig
label_desc: Use image node_id 3 for calling a global function with example usage: build_subclass_dict(subclasses) and returns: subclasses_dict