code: def testDumpUiMetadata(self):
      trainer = pipeline_pb2.PipelineNode()
      trainer.node_info.type.name = (
          "tfx.components.trainer.component.Trainer"
      )
      model_run_out_spec = pipeline_pb2.OutputSpec(
          artifact_spec=pipeline_pb2.OutputSpec.ArtifactSpec(
              type=metadata_store_pb2.ArtifactType(
                  name=standard_artifacts.ModelRun.TYPE_NAME
              )
          )
      )
      trainer.outputs.outputs["model_run"].CopyFrom(model_run_out_spec)
  
      model_run = standard_artifacts.ModelRun()
      model_run.uri = "model_run_uri"
      exec_info = data_types.ExecutionInfo(
          input_dict={},
          output_dict={"model_run": [model_run]},
          exec_properties={},
          execution_id="id",
      )
      ui_metadata_path = os.path.join(
          os.environ.get(
              "TEST_UNDECLARED_OUTPUTS_DIR", self.get_temp_dir()
          ),
          self._testMethodName,
          "json",
      )
      fileio.makedirs(os.path.dirname(ui_metadata_path))
      container_entrypoint._dump_ui_metadata(
          trainer, exec_info, ui_metadata_path
      )
      with open(ui_metadata_path) as f:
          ui_metadata = json.load(f)
          self.assertEqual(
              "tensorboard", ui_metadata["outputs"][-1]["type"]
          )
          self.assertEqual(
              "model_run_uri", ui_metadata["outputs"][-1]["source"]
          )
  
imports: import json
  import os
  from unittest import mock
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.orchestration import metadata
  from tfx.orchestration.kubeflow import container_entrypoint
  from tfx.orchestration.kubeflow import kubeflow_dag_runner
  from tfx.orchestration.kubeflow.proto import kubeflow_pb2
  from tfx.orchestration.portable import beam_executor_operator
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable import execution_publish_utils
  from tfx.orchestration.portable import launcher
  from tfx.orchestration.portable import outputs_utils
  from tfx.orchestration.portable import python_driver_operator
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import driver_output_pb2
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import standard_artifacts
  from tfx.utils import io_utils
  from tfx.utils import test_case_utils
  from google.protobuf import json_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 4 for calling the MLMDConfigTest obj's underlying member method code with example usage: obj.testDumpUiMetadata() without return types