code: def test_optimize_traversal(
      self,
      feature_spec: Mapping[str, common_types.FeatureSpecType],
      preprocessing_fn: Callable[
          [Mapping[str, common_types.TensorType]],
          Mapping[str, common_types.TensorType],
      ],
      dataset_input_cache_dicts: List[Mapping[str, str]],
      expected_dot_graph_str: str,
  ):
      dataset_keys = [
          analyzer_cache.DatasetKey("span-0"),
          analyzer_cache.DatasetKey("span-1"),
      ]
      if dataset_input_cache_dicts is not None:
          cache = {
              key: analyzer_cache.DatasetCache(
                  cache_dict, analyzer_cache.DatasetCacheMetadata(1)
              )
              for key, cache_dict in zip(
                  dataset_keys, dataset_input_cache_dicts
              )
          }  # pyformat: disable
      else:
          cache = {}
      dot_string = self._publish_rendered_dot_graph_file(
          preprocessing_fn, feature_spec, set(dataset_keys), cache
      )
  
      self.assertSameElements(
          expected_dot_graph_str.split("\n"),
          dot_string.split("\n"),
          msg="Result dot graph is:\n{}".format(dot_string),
      )
  
imports: import functools
  import os
  import struct
  from typing import Callable, Mapping, List
  import uuid
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  import tensorflow_transform
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import common_types
  from tensorflow_transform import impl_helper
  from tensorflow_transform import nodes
  import tensorflow_transform.beam
  from tensorflow_transform.beam import analysis_graph_builder
  from tensorflow_transform.beam import analyzer_cache
  from tensorflow_transform.beam import tft_unit
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 12 for calling the CachedImplTest obj's underlying member method code with example usage: obj.test_optimize_traversal(feature_spec, preprocessing_fn, dataset_input_cache_dicts, expected_dot_graph_str) without return types