docstr: Helper function returns artifacts of specified pipeline and type.
docstr_tok: ["Helper","function","returns","artifacts","of","specified","pipeline","and","type","."]
code: def _get_artifacts_with_type_and_pipeline(
      self, type_name: str, pipeline_name: str
  ) -> List[metadata_store_pb2.Artifact]:
      """Helper function returns artifacts of specified pipeline and type."""
      # 1. Find the pipeline context according to its name.
      request = (
          metadata_store_service_pb2.GetContextByTypeAndNameRequest(
              type_name=_CONTEXT_TYPE_PIPELINE,
              context_name=pipeline_name,
          )
      )
      pipeline_context = self._stub.GetContextByTypeAndName(request)
      # 2. Find the artifacts associated with the pipeline context.
      request = metadata_store_service_pb2.GetArtifactsByContextRequest(
          context_id=pipeline_context.context.id
      )
      artifacts_response = self._stub.GetArtifactsByContext(request)
      # 3. Find the specified artifact type id.
      artifact_type_request = (
          metadata_store_service_pb2.GetArtifactTypeRequest(
              type_name=type_name
          )
      )
      artifact_type = self._stub.GetArtifactType(
          artifact_type_request
      ).artifact_type
      # 4. Filter the returned artifacts according to their types and return.
      return [
          artifact
          for artifact in artifacts_response.artifacts
          if artifact.type_id == artifact_type.id
      ]
  
imports: import os
  import subprocess
  import time
  from typing import List
  from absl import logging
  from grpc import insecure_channel
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.orchestration import test_utils
  from tfx.orchestration.experimental.core.testing import test_dynamic_exec_properties_pipeline
  from tfx.orchestration.kubeflow import test_utils
  from tfx.orchestration.test_pipelines import download_grep_print_pipeline
  from tfx.types import standard_artifacts
  from ml_metadata.proto import metadata_store_pb2
  from ml_metadata.proto import metadata_store_service_pb2
  from ml_metadata.proto import metadata_store_service_pb2_grpc
label_desc: Use image node_id 5 for calling the KubeflowEndToEndTest obj's underlying member method code with example usage: obj._get_artifacts_with_type_and_pipeline(type_name, pipeline_name) and returns: unknown