code: def _get_output_artifacts(
      store: mlmd.MetadataStore,
      executions: Sequence[metadata_store_pb2.Execution],
      output_key: Optional[str] = None,
  ) -> List[metadata_store_pb2.Artifact]:
      """Get all output artifacts of the given executions."""
      executions_ids = [e.id for e in executions]
      events = [
          v
          for v in store.get_events_by_execution_ids(executions_ids)
          if event_lib.is_valid_output_event(v, output_key)
      ]
      artifact_ids = [v.artifact_id for v in events]
      return store.get_artifacts_by_id(artifact_ids)
  
file_path: tfx/tfx/orchestration/portable/input_resolution/channel_resolver.py
imports: from typing import List, Optional, Sequence, Tuple
  from absl import logging
  from tfx import types
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable.mlmd import event_lib
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact_utils
  import ml_metadata
  from ml_metadata import errors
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _get_output_artifacts(store, executions, output_key) and returns: store