code: def flatten_params(d, parent_key="", sep="/"):
      """Flattens a dictionary, keeping empty leaves."""
      items = []
      for k, v in d.items():
          path = parent_key + sep + k if parent_key else k
          if isinstance(v, abc.MutableMapping):
              items.extend(flatten_params(v, path, sep=sep).items())
          else:
              items.append((path, v))
      # Keeps the empty dict if it was set explicitly.
      if parent_key and not d:
          items.append((parent_key, {}))
      return dict(items)
  
file_path: scenic/scenic/projects/avatar/model_utils.py
imports: from collections import abc
  from typing import Any
  from absl import logging
  import flax
  import ml_collections
  from scenic.common_lib import debug_utils
  from scenic.projects.mbt.model_utils import init_embedding
  from scenic.projects.mbt.model_utils import init_encoderblock
  from scenic.projects.mbt.model_utils import init_posemb
label_desc: Use image node_id 1 for calling a global function with example usage: flatten_params(d, parent_key, sep) and returns: dict