code: def _flatten_flax_to_haiku_inner(
      collection: FlaxCollection,
      out: MutableHaikuParamsOrState,
      prefix: Sequence[str],
  ) -> HaikuParamsOrState:
      """Recursive inner loop of `flatten_flax_to_haiku`."""
      for name, value in collection.items():
          if isinstance(value, Mapping):
              _flatten_flax_to_haiku_inner(
                  value, out=out, prefix=(*prefix, name)
              )
          else:
              assert prefix
              mod_name = "/".join(prefix)
              if mod_name not in out:
                  out[mod_name] = {}
              out[mod_name][name] = value
      return out
  
imports: from collections.abc import Mapping, MutableMapping, Sequence
  from typing import Any, Union
  from haiku._src import typing
label_desc: Use image node_id 2 for calling a global function with example usage: _flatten_flax_to_haiku_inner(collection, out, prefix) and returns: out