code: def _get_mlmd_connection(path: str) -> metadata.Metadata:
      """Returns a MetadataStore for performing MLMD API calls."""
      if os.path.isfile(path):
          raise IOError("File already exists: %s" % path)
      connection_config = metadata.sqlite_metadata_connection_config(
          path
      )
      connection_config.sqlite.SetInParent()
      return metadata.Metadata(connection_config=connection_config)
  
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 1 for calling a global function with example usage: _get_mlmd_connection(path) and returns: metadata