code: def _compute_field_reference_replace_map(
      config: Union[
          ml_collections.ConfigDict, Mapping[str, Any], Iterable[Any]
      ],
      new_config: Union[
          ml_collections.ConfigDict, Mapping[str, Any], Iterable[Any]
      ],
      field_reference_replace_map: MutableMapping[
          int, ml_collections.FieldReference
      ],
  ) -> None:
      """Computes the mapping from the old field references to the new ones."""
      if isinstance(config, (ml_collections.ConfigDict, Mapping)):
          fields = (
              config._fields
              if isinstance(  # pylint: disable=protected-access
                  config, ml_collections.ConfigDict
              )
              else config
          )
          new_fields = (
              new_config._fields
              if isinstance(  # pylint: disable=protected-access
                  new_config, ml_collections.ConfigDict
              )
              else new_config
          )
          it = ((v, new_fields[k]) for k, v in fields.items())
      else:
          it = zip(config, new_config)
  
      for v, new_v in it:
          if isinstance(v, ml_collections.FieldReference):
              field_reference_replace_map[id(v)] = new_v
          elif isinstance(
              v, (ml_collections.ConfigDict, Iterable)
          ) and not isinstance(config, (str, bytes)):
              _compute_field_reference_replace_map(
                  v, new_v, field_reference_replace_map
              )
  
imports: from collections.abc import Callable
  from collections.abc import Iterable
  from collections.abc import Iterator
  from collections.abc import Mapping
  from collections.abc import MutableMapping
  from collections.abc import Sequence
  import copy
  import types
  from typing import Any
  from typing import Optional
  from typing import TypeVar
  from typing import Union
  from dmvr import tokenizers
  import jax
  import ml_collections
label_desc: Use image node_id 2 for calling a global function with example usage: _compute_field_reference_replace_map(config, new_config, field_reference_replace_map) without return types