code: def testGetInputsAndOutputs(self):
      # Create and shuffle a few artifacts. The shuffled order should be
      # retained in the output of `execution_lib.get_input_artifacts`.
      input_artifact_keys = ("input1", "input2", "input3")
      expected_input_artifacts = collections.OrderedDict()
      for input_key in input_artifact_keys:
          input_examples = []
          for i in range(10):
              input_example = standard_artifacts.Examples()
              input_example.uri = f"{input_key}/example{i}"
              input_example.type_id = (
                  common_utils.register_type_if_not_exist(
                      self._mlmd_handle, input_example.artifact_type
                  ).id
              )
              input_examples.append(input_example)
          random.shuffle(input_examples)
          expected_input_artifacts[input_key] = input_examples
  
      output_models = []
      for i in range(8):
          output_model = standard_artifacts.Model()
          output_model.uri = f"model{i}"
          output_model.type_id = (
              common_utils.register_type_if_not_exist(
                  self._mlmd_handle, output_model.artifact_type
              ).id
          )
          output_models.append(output_model)
      random.shuffle(output_models)
      expected_output_artifacts = {"model": output_models}
  
      # Store input artifacts only. Outputs will be saved in put_execution().
      input_mlmd_artifacts = [
          a.mlmd_artifact
          for a in itertools.chain(*expected_input_artifacts.values())
      ]
      artifact_ids = self._mlmd_handle.store.put_artifacts(
          input_mlmd_artifacts
      )
      for artifact_id, mlmd_artifact in zip(
          artifact_ids, input_mlmd_artifacts
      ):
          mlmd_artifact.id = artifact_id
  
      execution = execution_lib.prepare_execution(
          self._mlmd_handle,
          metadata_store_pb2.ExecutionType(name="my_execution_type"),
          state=metadata_store_pb2.Execution.RUNNING,
      )
      contexts = self._generate_contexts(self._mlmd_handle)
  
      # Change the order of the OrderedDict to shuffle the order of input keys.
      expected_input_artifacts.move_to_end("input1")
      execution = execution_lib.put_execution(
          self._mlmd_handle,
          execution,
          contexts,
          input_artifacts=expected_input_artifacts,
          output_artifacts=expected_output_artifacts,
      )
  
      # Verify that the same artifacts are returned in the correct order.
      input_artifacts = execution_lib.get_input_artifacts(
          self._mlmd_handle, execution.id
      )
      output_artifacts = execution_lib.get_output_artifacts(
          self._mlmd_handle, execution.id
      )
      self.assertEqual(
          set(input_artifact_keys), set(input_artifacts.keys())
      )
      for key in input_artifacts:
          self.assertEqual(
              [ex.uri for ex in expected_input_artifacts[key]],
              [a.uri for a in input_artifacts[key]],
              f"for key={key}",
          )
      self.assertEqual({"model"}, set(output_artifacts.keys()))
      self.assertEqual(
          [model.uri for model in output_models],
          [a.uri for a in output_artifacts["model"]],
      )
      self.assertEqual(
          output_artifacts["model"][0].mlmd_artifact.type,
          standard_artifacts.Model.TYPE_NAME,
      )
  
imports: import collections
  import itertools
  import random
  from typing import Sequence
  from absl.testing import parameterized
  import tensorflow
  from tfx import types
  from tfx import version
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration.portable.mlmd import common_utils
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.utils import test_case_utils
  from tfx.utils import typing_utils
  from google.protobuf import text_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 10 for calling the ExecutionLibTest obj's underlying member method code with example usage: obj.testGetInputsAndOutputs() without return types