class_docstr: Visitor optimizes the operation graph (see nodes.py).
  
  This operates on the translated graph which is emitted by the
  `_TranslateVisitor`, and performs optimizations.
  
  Namely, when enabled, this enables reading and writing from/to analyzer
  accumulator cache to avoid recomputing them over already seen datasets.
  This type of optimization requires also creating a partitioned view of the
  input data, according to the `is_partitionable` annotation.
docstr: Returns a list of sideeffect leaf nodes after the visit is done.
docstr_tok: ["Returns","a","list","of","sideeffect","leaf","nodes","after","the","visit","is","done","."]
code: def get_detached_sideeffect_leafs(self):
      """Returns a list of sideeffect leaf nodes after the visit is done."""
      # If this is a multi-phase analysis, then all datasets have to be read
      # anyway, and so we'll not instrument full cache coverage for this case.
      if self._num_phases > 1:
          return []
      dataset_keys_with_decoded_cache = []
      for dataset_key in self._sorted_dataset_keys:
          # Default to True here, if the dataset_key is not in the cache misses map
          # then treat it like it does have cache misses because it has not been
          # visited in the optimization traversal.
          if self._dataset_has_cache_misses.get(dataset_key, True):
              continue
          # Default to None if the dataset_key isn't present in the cache dict, it
          # means that there is not cache present for this dataset, so we should not
          # instrument cache for it.
          cache_dict = self._cache_dict or {}
          dataset_cache_entries = cache_dict.get(dataset_key, None)
          if (
              dataset_cache_entries is not None
              and dataset_cache_entries.metadata
          ):
              dataset_keys_with_decoded_cache.append(dataset_key)
      if (
          dataset_keys_with_decoded_cache
          or self._num_encode_cache_nodes
          or self._num_decode_cache_nodes
      ):
          return [
              nodes.apply_operation(
                  analyzer_nodes.InstrumentDatasetCache,
                  input_cache_dataset_keys=dataset_keys_with_decoded_cache,
                  num_encode_cache=self._num_encode_cache_nodes,
                  num_decode_cache=self._num_decode_cache_nodes,
                  label="InstrumentDatasetCache",
              )
          ]
      return []
  
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 3 for calling the _OptimizeVisitor obj's underlying member method code with example usage: obj.get_detached_sideeffect_leafs() and returns: list, list, list