code: def fake_execute_node(
      mlmd_connection,
      task,
      artifact_custom_properties=None,
      success=True,
  ):
      """Simulates node execution given ExecNodeTask."""
      node = task.get_node()
      with mlmd_connection as m:
          if node.HasField("outputs"):
              output_key, output_value = next(
                  iter(node.outputs.outputs.items())
              )
              output = types.Artifact(output_value.artifact_spec.type)
              if artifact_custom_properties:
                  for key, val in artifact_custom_properties.items():
                      if isinstance(val, int):
                          output.set_int_custom_property(key, val)
                      elif isinstance(val, str):
                          output.set_string_custom_property(key, val)
                      else:
                          raise ValueError(
                              f"unsupported type: {type(val)}"
                          )
              output.uri = str(uuid.uuid4())
              output_artifacts = {output_key: [output]}
          else:
              output_artifacts = None
  
          if success:
              execution_publish_utils.publish_succeeded_execution(
                  m, task.execution_id, task.contexts, output_artifacts
              )
          else:
              execution_publish_utils.publish_failed_execution(
                  m, task.contexts, task.execution_id
              )
  
imports: import os
  from typing import Dict, Optional
  import uuid
  from absl.testing.absltest import mock
  from tfx import types
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.experimental.core import env
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import cache_utils
  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 pipeline_pb2
  from tfx.types import standard_artifacts
  from tfx.utils import status
  from tfx.utils import test_case_utils
  from tfx.utils import typing_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 10 for calling a global function with example usage: fake_execute_node(mlmd_connection, task, artifact_custom_properties, success) without return types