class_docstr: Utility class to manage a set of ``ConfigItem`` and resolve the references between them.
  
  This class maintains a set of ``ConfigItem`` objects and their associated IDs.
  The IDs must be unique within this set. A string in ``ConfigItem``
  starting with ``@`` will be treated as a reference to other ``ConfigItem`` objects by ID.
  Since ``ConfigItem`` may have a nested dictionary or list structure,
  the reference string may also contain the separator ``::`` to refer to a substructure by
  key indexing for a dictionary or integer indexing for a list.
  
  In this class, resolving references is essentially substitution of the reference strings with the
  corresponding python objects. A typical workflow of resolving references is as follows:
  
      - Add multiple ``ConfigItem`` objects to the ``ReferenceResolver`` by ``add_item()``.
      - Call ``get_resolved_content()`` to automatically resolve the references. This is done (recursively) by:
          - Convert the items to objects, for those do not have references to other items.
              - If it is instantiable, instantiate it and cache the class instance in ``resolved_content``.
              - If it is an expression, evaluate it and save the value in ``resolved_content``.
          - Substitute the reference strings with the corresponding objects.
  
  Args:
      items: ``ConfigItem``s to resolve, this could be added later with ``add_item()``.
docstr: Resolve and return one ``ConfigItem`` of ``id``, cache the resolved result in ``resolved_content``.
  If it has unresolved references, recursively resolve the referring items first.
  
  Args:
      id: id name of ``ConfigItem`` to be resolved.
      waiting_list: set of ids pending to be resolved.
          It's used to detect circular references such as:
          `{"name": "A", "dep": "@B"}` and `{"name": "B", "dep": "@A"}`.
      kwargs: keyword arguments to pass to ``_resolve_one_item()``.
          Currently support ``instantiate``, ``eval_expr`` and ``default``.
          `instantiate` and `eval_expr` are defaulting to True, `default` is the target config item
          if the `id` is not in the config content, must be a `ConfigItem` object.
docstr_tok: ["Resolve","and","return","one","``","ConfigItem","``","of","``","id","``",",","cache","the","resolved","result","in","``","resolved_content","``",".","If","it","has","unresolved","references",",","recursively","resolve","the","referring","items","first",".","Args",":","id",":","id","name","of","``","ConfigItem","``","to","be","resolved",".","waiting_list",":","set","of","ids","pending","to","be","resolved",".","It","'s","used","to","detect","circular","references","such","as",":","`","{","``","name","''",":","``","A","''",",","``","dep","''",":","``","@","B","''","}","`","and","`","{","``","name","''",":","``","B","''",",","``","dep","''",":","``","@","A","''","}","`",".","kwargs",":","keyword","arguments","to","pass","to","``","_resolve_one_item","(",")","``",".","Currently","support","``","instantiate","``",",","``","eval_expr","``","and","``","default","``",".","`","instantiate","`","and","`","eval_expr","`","are","defaulting","to","True",",","`","default","`","is","the","target","config","item","if","the","`","id","`","is","not","in","the","config","content",",","must","be","a","`","ConfigItem","`","object","."]
code: def _resolve_one_item(
      self, id: str, waiting_list: set[str] | None = None, **kwargs: Any
  ) -> ConfigExpression | str | Any | None:
      """
      Resolve and return one ``ConfigItem`` of ``id``, cache the resolved result in ``resolved_content``.
      If it has unresolved references, recursively resolve the referring items first.
  
      Args:
          id: id name of ``ConfigItem`` to be resolved.
          waiting_list: set of ids pending to be resolved.
              It's used to detect circular references such as:
              `{"name": "A", "dep": "@B"}` and `{"name": "B", "dep": "@A"}`.
          kwargs: keyword arguments to pass to ``_resolve_one_item()``.
              Currently support ``instantiate``, ``eval_expr`` and ``default``.
              `instantiate` and `eval_expr` are defaulting to True, `default` is the target config item
              if the `id` is not in the config content, must be a `ConfigItem` object.
  
      """
      id = self.normalize_id(id)
      if id in self.resolved_content:
          return self.resolved_content[id]
      try:
          item = look_up_option(
              id,
              self.items,
              print_all_options=False,
              default=kwargs.get("default", "no_default"),
          )
      except ValueError as err:
          raise KeyError(
              f"id='{id}' is not found in the config resolver."
          ) from err
      if not isinstance(item, ConfigItem):
          return item
      item_config = item.get_config()
  
      if waiting_list is None:
          waiting_list = set()
      waiting_list.add(id)
  
      for t, v in self.items.items():
          if (
              t not in self.resolved_content
              and isinstance(v, ConfigExpression)
              and v.is_import_statement(v.get_config())
          ):
              self.resolved_content[t] = (
                  v.evaluate() if kwargs.get("eval_expr", True) else v
              )
      for d in self.find_refs_in_config(
          config=item_config, id=id
      ).keys():
          # if current item has reference already in the waiting list, that's circular references
          if d in waiting_list:
              raise ValueError(
                  f"detected circular references '{d}' for id='{id}' in the config content."
              )
          # check whether the component has any unresolved references
          if d not in self.resolved_content:
              # this referring item is not resolved
              try:
                  look_up_option(d, self.items, print_all_options=False)
              except ValueError as err:
                  msg = f"the referring item `@{d}` is not defined in the config content."
                  if not self.allow_missing_reference:
                      raise ValueError(msg) from err
                  warnings.warn(msg)
                  continue
              # recursively resolve the reference first
              self._resolve_one_item(
                  id=d, waiting_list=waiting_list, **kwargs
              )
              waiting_list.discard(d)
  
      # all references are resolved, then try to resolve current config item
      new_config = self.update_config_with_refs(
          config=item_config, id=id, refs=self.resolved_content
      )
      item.update_config(config=new_config)
      # save the resolved result into `resolved_content` to recursively resolve others
      if isinstance(item, ConfigComponent):
          self.resolved_content[id] = (
              item.instantiate()
              if kwargs.get("instantiate", True)
              else item
          )
      elif isinstance(item, ConfigExpression):
          run_eval = kwargs.get("eval_expr", True)
          self.resolved_content[id] = (
              item.evaluate(
                  globals={f"{self._vars}": self.resolved_content}
              )
              if run_eval
              else item
          )
      else:
          self.resolved_content[id] = new_config
      return self.resolved_content[id]
  
imports: from __future__ import annotations
  import re
  import warnings
  from collections.abc import Sequence
  from typing import Any, Iterator
  from monai.bundle.config_item import ConfigComponent, ConfigExpression, ConfigItem
  from monai.bundle.utils import ID_REF_KEY, ID_SEP_KEY
  from monai.utils import allow_missing_reference, look_up_option
label_desc: Use image node_id 6 for calling the ReferenceResolver obj's underlying member method code with example usage: obj._resolve_one_item(id, waiting_list) and returns: self, self, item