code: def testPublishSuccessfulExecutionOmitsArtifactIfNotResolvedDuringRuntime(
      self,
  ):
      with metadata.Metadata(
          connection_config=self._connection_config
      ) as m:
          contexts = self._generate_contexts(m)
          execution_id = execution_publish_utils.register_execution(
              m, self._execution_type, contexts
          ).id
          runtime_resolved_external_artifact = (
              standard_artifacts.Examples()
          )
          runtime_resolved_external_artifact.uri = (
              outputs_utils.RESOLVED_AT_RUNTIME
          )
          runtime_resolved_external_artifact.is_external = True
          predefined_external_artifact = standard_artifacts.Examples()
          predefined_external_artifact.uri = "/foo/bar"
          predefined_external_artifact.is_external = True
          original_artifacts = {
              "key1": [runtime_resolved_external_artifact],
              "key2": [
                  copy.deepcopy(runtime_resolved_external_artifact),
                  predefined_external_artifact,
              ],
          }
          executor_output = execution_result_pb2.ExecutorOutput()
          text_format.Parse(
              f"""
            uri: '{outputs_utils.RESOLVED_AT_RUNTIME}'
            custom_properties {{
              key: 'is_external'
              value {{int_value: 1}}
            }}
            """,
              executor_output.output_artifacts["key1"].artifacts.add(),
          )
          (
              output_dict,
              _,
          ) = execution_publish_utils.publish_succeeded_execution(
              m,
              execution_id,
              contexts,
              original_artifacts,
              executor_output,
          )
          self.assertEmpty(output_dict["key1"])
          self.assertNotEmpty(output_dict["key2"])
          self.assertLen(output_dict["key2"], 1)
          self.assertEqual(output_dict["key2"][0].uri, "/foo/bar")
  
imports: import copy
  from absl.testing import parameterized
  import tensorflow
  from tfx import version
  from tfx.orchestration import metadata
  from tfx.orchestration.portable import execution_publish_utils
  from tfx.orchestration.portable import outputs_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 google.protobuf import text_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 7 for calling the ExecutionPublisherTest obj's underlying member method code with example usage: obj.testPublishSuccessfulExecutionOmitsArtifactIfNotResolvedDuringRuntime() without return types