code: def _format_output_cache(
      cache_value_nodes: _IntermediateCacheType,
  ) -> Optional[AnalysisCache]:
      """Triggers dataset cache encoding and composes analysis cache output."""
      if cache_value_nodes is None:
          return None
      cache_dict = collections.defaultdict(dict)
      for (
          dataset_key,
          cache_key,
      ), value_node in cache_value_nodes.items():
          cache_dict[dataset_key][cache_key] = value_node
      return cache_dict
  
imports: import collections
  import dataclasses
  import hashlib
  from typing import Collection, Dict, Mapping, Optional, Tuple
  from typing import OrderedDict
  import tensorflow
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform import impl_helper
  from tensorflow_transform import nodes
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import tf_utils
  from tensorflow_transform.beam import analyzer_cache
  from tensorflow_transform.beam import beam_nodes
  from tensorflow_transform.beam import combiner_packing_util
label_desc: Use image node_id 6 for calling a global function with example usage: _format_output_cache(cache_value_nodes) and returns: cache_dict, None