docstr: Helper function returns executions for a given state.
docstr_tok: ["Helper","function","returns","executions","for","a","given","state","."]
code: def _get_executions_by_pipeline_name_and_state(
      self,
      pipeline_name: str,
      state: metadata_store_pb2.Execution.State,
  ) -> List[metadata_store_pb2.Execution]:
      """Helper function returns executions for a given state."""
      executions = self._get_executions_by_pipeline_name(pipeline_name)
      result = []
      for e in executions:
          if e.last_known_state == state:
              result.append(e)
  
      return result
  
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 8 for calling the KubeflowEndToEndTest obj's underlying member method code with example usage: obj._get_executions_by_pipeline_name_and_state(pipeline_name, state) and returns: result