class_docstr: Class that analyzes a graph to determine readiness of tensors.
docstr: Compute analysis result for a tensor or op with its parent results.
docstr_tok: ["Compute","analysis","result","for","a","tensor","or","op","with","its","parent","results","."]
code: def _compute_analysis_result(
      self, tensor_or_op, parent_analysis_results
  ):
      """Compute analysis result for a tensor or op with its parent results."""
      hashable = tf_utils.hashable_tensor_or_op(tensor_or_op)
      if hashable in self._source_info_dict:
          source_info = self._source_info_dict[hashable]
          # source_info.name may be None but that just means that it relies on an
          # output of a previous analyzer, so that's ok.
          return _AnalysisResult(
              is_ready_to_run=source_info.is_ready_to_run,
              path=self._translate_path_fn(source_info.name),
              dependent_sources={hashable},
          )
  
      func_graphs_analysis_results = (
          self._compute_analysis_results_for_func_attributes(
              tensor_or_op, parent_analysis_results
          )
      )
  
      result = _AnalysisResult(
          is_ready_to_run=all(
              analysis_result.is_ready_to_run
              for analysis_result in (
                  parent_analysis_results + func_graphs_analysis_results
              )
          ),
          path=self._translate_path_fn(
              tensor_or_op,
              parents=[
                  parent_analysis_result.path
                  for parent_analysis_result in parent_analysis_results
              ]
              + [
                  func_result.path
                  for func_result in func_graphs_analysis_results
              ],
          ),
          dependent_sources=set(),
      )
      for parent_analysis_result in parent_analysis_results:
          result.dependent_sources.update(
              parent_analysis_result.dependent_sources
          )
      for func_result in func_graphs_analysis_results:
          result.dependent_sources.update(func_result.dependent_sources)
      return result
  
imports: import collections
  import copy
  import hashlib
  import itertools
  from typing import Iterable, List, Mapping, Optional, Set, Union
  import uuid
  from absl import logging
  import tensorflow
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import common_types
  from tensorflow_transform import nodes
  from tensorflow_transform import tf_utils
  from tfx_bsl.types import tfx_namedtuple
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import function_def_to_graph
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 4 for calling the _GraphAnalyzer obj's underlying member method code with example usage: obj._compute_analysis_result(tensor_or_op, parent_analysis_results) and returns: result, _AnalysisResult