code: def main_factory(
      mlmd_connection_func: Callable[[str], metadata.Metadata],
      execute_nodes_func: Callable[
          [metadata.Metadata, pipeline_pb2.Pipeline, int], None
      ] = _execute_nodes,
  ):
      def main(argv):
          del argv
          with mlmd_connection_func(FLAGS.path) as m:
              depl_config = pipeline_pb2.IntermediateDeploymentConfig()
              executor_spec = (
                  pipeline_pb2.ExecutorSpec.PythonClassExecutorSpec(
                      class_path="fake.ClassPath"
                  )
              )
              depl_config.executor_specs["arg1"].Pack(executor_spec)
              depl_config.executor_specs["arg2"].Pack(executor_spec)
              create_sample_pipeline(
                  m,
                  FLAGS.pipeline_id,
                  FLAGS.pipeline_run_num,
                  FLAGS.export_ir_dir,
                  FLAGS.ir_file,
                  depl_config,
                  execute_nodes_func,
              )
  
      return main
  
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 6 for calling a global function with example usage: main_factory(mlmd_connection_func, execute_nodes_func) and returns: main