code: def _update_pipeline_run_id(
      pipeline: pipeline_pb2.Pipeline, execution_id: int
  ):
      """Rewrites pipeline run id in a given pipeline IR."""
      old_pipeline_run_id = (
          pipeline.runtime_spec.pipeline_run_id.field_value.string_value
      )
      new_pipeline_run_id = old_pipeline_run_id + f"_{execution_id}"
  
      def _node_updater(node: pipeline_pb2.PipelineNode):
          for context_spec in node.contexts.contexts:
              if (
                  context_spec.type.name == "pipeline_run"
                  and context_spec.name.field_value.string_value
                  == old_pipeline_run_id
              ):
                  context_spec.name.field_value.string_value = (
                      new_pipeline_run_id
                  )
          for input_spec in node.inputs.inputs.values():
              for channel in input_spec.channels:
                  for context_query in channel.context_queries:
                      if (
                          context_query.type.name == "pipeline_run"
                          and context_query.name.field_value.string_value
                          == old_pipeline_run_id
                      ):
                          context_query.name.field_value.string_value = (
                              new_pipeline_run_id
                          )
  
      _visit_pipeline_nodes_recursively(pipeline, _node_updater)
      pipeline.runtime_spec.pipeline_run_id.field_value.string_value = (
          new_pipeline_run_id
      )
  
imports: import copy
  import threading
  from typing import Callable, Optional
  from absl import flags
  from absl import logging
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import pipeline_ops
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_scheduler
  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.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: _update_pipeline_run_id(pipeline, execution_id) without return types