code: def publish_cached_executions(
      metadata_handle: metadata.Metadata,
      contexts: Sequence[metadata_store_pb2.Context],
      executions: Sequence[metadata_store_pb2.Execution],
      output_artifacts_maps: Optional[
          Sequence[typing_utils.ArtifactMultiMap]
      ] = None,
  ) -> None:
      """Marks an existing execution as using cached outputs from a previous execution.
  
      Args:
        metadata_handle: A handler to access MLMD.
        contexts: MLMD contexts to associated with the execution.
        executions: Executions that will be published as CACHED executions.
        output_artifacts_maps: A list of output artifacts of the executions. Each
          artifact will be linked with the execution through an event of type OUTPUT
      """
      for execution in executions:
          execution.last_known_state = (
              metadata_store_pb2.Execution.CACHED
          )
  
      execution_lib.put_executions(
          metadata_handle,
          executions,
          contexts,
          output_artifacts_maps=output_artifacts_maps,
      )
  
file_path: tfx/tfx/orchestration/portable/execution_publish_utils.py
imports: from typing import Mapping, Optional, Sequence
  import uuid
  from tfx import types
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration.portable import merge_utils
  from tfx.orchestration.portable import outputs_utils
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.utils import typing_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: publish_cached_executions(metadata_handle, contexts, executions, output_artifacts_maps) without return types