code: def _get_node_live_artifacts(
      store: mlmd.MetadataStore,
      *,
      pipeline_id: str,
      node_id: str,
      pipeline_run_id: Optional[str] = None,
  ) -> Sequence[mlmd.proto.Artifact]:
      """Gets all LIVE node artifacts.
  
      Args:
        store: A MetadataStore object.
        pipeline_id: The pipeline ID.
        node_id: The node ID.
        pipeline_run_id: The pipeline run ID that the node belongs to. Only
          artifacts from the specified pipeline run are returned if specified.
  
      Returns:
        A list of LIVE artifacts of the given pipeline node.
      """
      artifact_state_filter_query = f"state = {mlmd.proto.Artifact.State.Name(mlmd.proto.Artifact.LIVE)}"
      node_context_name = compiler_utils.node_context_name(
          pipeline_id, node_id
      )
      node_filter_query = q.And(
          [
              f'contexts_0.type = "{constants.NODE_CONTEXT_TYPE_NAME}"',
              f'contexts_0.name = "{node_context_name}"',
          ]
      )
  
      artifact_filter_query = q.And(
          [
              node_filter_query,
              artifact_state_filter_query,
          ]
      )
  
      if pipeline_run_id:
          artifact_filter_query.append(
              q.And(
                  [
                      f'contexts_1.type = "{constants.PIPELINE_RUN_CONTEXT_TYPE_NAME}"',
                      f'contexts_1.name = "{pipeline_run_id}"',
                  ]
              )
          )
  
      return store.get_artifacts(
          list_options=mlmd.ListOptions(
              filter_query=str(artifact_filter_query)
          )
      )
  
file_path: tfx/tfx/orchestration/portable/mlmd/store_ext.py
imports: import collections
  import itertools
  from typing import Callable, Mapping, Optional, Sequence, Union
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.compiler import constants
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.portable.mlmd import event_lib
  from tfx.orchestration.portable.mlmd import filter_query_builder
  import ml_metadata
label_desc: Use image node_id 3 for calling a global function with example usage: _get_node_live_artifacts(store) and returns: store