code: def freeze(xs: Mapping[Any, Any]) -> FrozenDict[Any, Any]:
      """Freeze a nested dict.
  
      Makes a nested ``dict`` immutable by transforming it into ``FrozenDict``.
  
      Args:
        xs: Dictionary to freeze (a regualr Python dict).
      Returns:
        The frozen dictionary.
      """
      return FrozenDict(xs)
  
imports: import collections
  from types import MappingProxyType
  from typing import Any, Dict, Hashable, Mapping, Tuple, TypeVar, Union
  import jax
  from flax import serialization
label_desc: Use image node_id 3 for calling a global function with example usage: freeze(xs) and returns: FrozenDict