code: def fake_cached_example_gen_run(
      mlmd_connection: metadata.Metadata,
      example_gen: pipeline_pb2.PipelineNode,
  ):
      """Writes fake cached example gen execution to MLMD."""
      with mlmd_connection as m:
          output_example = types.Artifact(
              example_gen.outputs.outputs["examples"].artifact_spec.type
          )
          output_example.set_int_custom_property("span", 1)
          output_example.set_int_custom_property("version", 1)
          output_example.uri = "my_examples_uri"
          output_example.mlmd_artifact.state = (
              metadata_store_pb2.Artifact.LIVE
          )
          cached_outputs = {"examples": [output_example]}
  
          contexts = context_lib.prepare_contexts(
              m, example_gen.contexts
          )
          execution = execution_publish_utils.register_execution(
              m, example_gen.node_info.type, contexts
          )
          execution_publish_utils.publish_cached_executions(
              m,
              contexts=contexts,
              executions=[execution],
              output_artifacts_maps=[cached_outputs],
          )
  
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 8 for calling a global function with example usage: fake_cached_example_gen_run(mlmd_connection, example_gen) without return types