code: def get_cached_outputs(
      metadata_handle: metadata.Metadata,
      cache_context: metadata_store_pb2.Context,
  ) -> Optional[Dict[str, List[types.Artifact]]]:
      """Tries to get the cached output artifacts given a cache context.
  
      Args:
        metadata_handle: A handler to access MLMD store.
        cache_context: The context representing the cache key.
  
      Returns:
        The cached output artifacts in a dict format. None if no qualified cache
        result is found.
      """
      # Only success executions should be the producer of cached outputs.
      cached_executions = filter(
          execution_lib.is_execution_successful,
          metadata_handle.store.get_executions_by_context(
              cache_context.id
          ),
      )
      if not cached_executions:
          return None
      # Sorts the candidate executions from newer to older.
      cached_executions = (
          execution_lib.sort_executions_newest_to_oldest(
              cached_executions
          )
      )
  
      # Defensively traverses candidate executions and returns once we find an
      # execution with valid outputs that can be confirmed to still exist.
      for execution in cached_executions:
          cached_output_artifacts = _get_outputs_of_execution(
              metadata_handle, execution.id
          )
          if cached_output_artifacts is not None:
              try:
                  artifact_utils.verify_artifacts(
                      cached_output_artifacts
                  )
                  return cached_output_artifacts
              except RuntimeError:
                  pass
  
      return None
  
file_path: tfx/tfx/orchestration/portable/cache_utils.py
imports: import collections
  import copy
  import hashlib
  from typing import Any, Dict, List, Mapping, Optional, Sequence
  from tfx import types
  from tfx.dsl.io import fileio
  from tfx.orchestration import metadata
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact_utils
  from google.protobuf import message
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: get_cached_outputs(metadata_handle, cache_context) and returns: None, None, cached_output_artifacts