code: def guess_list_config_type(
      objs, type_hint, _hint_list_item=False
  ) -> list[ConfigBase] | None:
      # avoid circular import
      from ..base import ConfigBase
      from ..training_service import TrainingServiceConfig
  
      # because __init__ of subclasses might be complex, we first create empty objects to determine type
      candidate_classes = []
      for cls in _all_subclasses(ConfigBase):
          if issubclass(
              cls, TrainingServiceConfig
          ):  # training service configs are specially handled
              continue
          empty_list = [cls.__new__(cls)]
          if _hint_list_item:
              good_type = is_instance(empty_list[0], type_hint)
          else:
              good_type = is_instance(empty_list, type_hint)
          if good_type:
              candidate_classes.append(cls)
  
      if not candidate_classes:  # it does not accept config type
          return None
      if (
          len(candidate_classes) == 1
      ):  # the type is confirmed, raise error if cannot convert to this type
          return [candidate_classes[0](**obj) for obj in objs]
  
      # multiple candidates available, call __init__ to further verify
      candidate_configs = []
      for cls in candidate_classes:
          try:
              configs = [cls(**obj) for obj in objs]
          except Exception:
              # FIXME: The reason why the guess failed is eaten here. We should at least print one of them.
              continue
          candidate_configs.append(configs)
  
      if not candidate_configs:
          return None
      if len(candidate_configs) == 1:
          return candidate_configs[0]
  
      # still have multiple candidates, choose the common base class
      for base in candidate_configs:
          base_class = type(base[0])
          is_base = all(
              isinstance(configs[0], base_class)
              for configs in candidate_configs
          )
          if is_base:
              return base
  
      return None
  
imports: from __future__ import annotations
  import copy
  import dataclasses
  import importlib
  import json
  import os.path
  from pathlib import Path
  import socket
  from typing import TYPE_CHECKING, get_type_hints
  import typeguard
  import nni.runtime.config
  from .public import is_missing
label_desc: Use image node_id 12 for calling a global function with example usage: guess_list_config_type(objs, type_hint, _hint_list_item) and returns: None, None, unknown, None, candidate_configs, base