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 []
Returns a list of sideeffect leaf nodes after the visit is done.
tensorflow_transform/beam/analysis_graph_builder.py