code: def _get_execution_dict(
      metadata_connection: metadata.Metadata,
  ) -> Mapping[str, List[metadata_store_pb2.Execution]]:
      """Returns a dictionary holding list of executions for all run_id in MLMD.
  
      Args:
        metadata_connection: Instance of metadata.Metadata for I/O to MLMD.
  
      Returns:
        A dictionary that holds list of executions for a run_id.
      """
      execution_dict = collections.defaultdict(list)
      for execution in metadata_connection.store.get_executions():
          execution_run_id = execution.properties["run_id"].string_value
          execution_dict[execution_run_id].append(execution)
      return execution_dict
  
file_path: tfx/tfx/experimental/pipeline_testing/pipeline_recorder_utils.py
imports: import collections
  import os
  from typing import Iterable, List, Mapping, Optional, Tuple
  from absl import logging
  from tfx.dsl.compiler import constants
  from tfx.orchestration import metadata
  from tfx.utils import io_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _get_execution_dict(metadata_connection) and returns: execution_dict