code: def test_get_latest_execution_set(
      self, execution_info_groups, expected_returned_execution_indices
  ):
      execution_type = metadata_store_pb2.ExecutionType(
          name="my_ex_type"
      )
  
      with self._mlmd_connection as m:
          # Construct execution sets.
          executions = []
          for execution_info_group in execution_info_groups:
              input_and_params = [
                  task_gen_utils.InputAndParam(
                      input_artifacts={
                          "input_example": [
                              standard_artifacts.Examples()
                          ]
                      }
                  )
              ] * len(execution_info_group)
              execution_group = []
              for idx, execution_info in enumerate(
                  execution_info_group
              ):
                  input_and_param = input_and_params[idx]
                  external_execution_index = execution_info[
                      "external_execution_index"
                  ]
                  execution = execution_lib.prepare_execution(
                      m,
                      execution_type,
                      metadata_store_pb2.Execution.NEW,
                      input_and_param.exec_properties,
                      execution_name=str(uuid.uuid4()),
                  )
                  if external_execution_index is not None:
                      execution.custom_properties[
                          task_gen_utils._EXTERNAL_EXECUTION_INDEX
                      ].int_value = external_execution_index
                  execution_group.append(execution)
              executions.extend(
                  execution_lib.put_executions(
                      m,
                      execution_group,
                      {},
                      [
                          input_and_param.input_artifacts
                          for input_and_param in input_and_params
                      ],
                  )
              )
              # sleep 10 ms to make sure two groups executions have different
              # `create_time_since_epoch`
              time.sleep(0.01)
  
          # Get expected results.
          expected_execution_set = [
              executions[i] for i in expected_returned_execution_indices
          ]
  
          # Call the target function and test against the expected results.
          executions = m.store.get_executions()
          self.assertLen(
              executions, sum([len(g) for g in execution_info_groups])
          )
  
          latest_execution_set = (
              task_gen_utils.get_latest_executions_set(executions)
          )
  
          for expected_execution, actual_execution in zip(
              expected_execution_set, latest_execution_set
          ):
              self.assertProtoPartiallyEquals(
                  expected_execution,
                  actual_execution,
                  ignored_fields=[
                      "type",
                      "create_time_since_epoch",
                      "last_update_time_since_epoch",
                  ],
              )
  
imports: import os
  import time
  from unittest import mock
  import uuid
  from absl.testing import parameterized
  import tensorflow
  from tfx import types
  from tfx import version
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration.experimental.core import test_utils
  from tfx.orchestration.experimental.core.testing import test_async_pipeline
  from tfx.orchestration.experimental.core.testing import test_dynamic_exec_properties_pipeline
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import outputs_utils
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import placeholder_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.utils import status
  from tfx.utils import test_case_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 10 for calling the TaskGenUtilsTest obj's underlying member method code with example usage: obj.test_get_latest_execution_set(execution_info_groups, expected_returned_execution_indices) without return types