code: def _get_ir_path(external_ir_file: str):
      if external_ir_file:
          return external_ir_file
      ir_file_path = tempfile.mktemp(suffix=".pbtxt")
      io_utils.write_pbtxt_file(
          ir_file_path, test_sync_pipeline.create_pipeline()
      )
      return ir_file_path
  
imports: import os
  import tempfile
  from typing import Optional, Callable
  from absl import app
  from absl import flags
  from tfx.dsl.compiler import constants
  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 test_utils
  from tfx.orchestration.experimental.core.testing import test_sync_pipeline
  from tfx.orchestration.portable import runtime_parameter_utils
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import io_utils
  from tfx.utils import status
  from google.protobuf import message
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: _get_ir_path(external_ir_file) and returns: ir_file_path, external_ir_file