code: def sqlite_metadata_connection_config(
      metadata_db_uri: str,
  ) -> metadata_store_pb2.ConnectionConfig:
      """Convenience function to create file based metadata connection config.
  
      Args:
        metadata_db_uri: uri to metadata db.
  
      Returns:
        A metadata_store_pb2.ConnectionConfig based on given metadata db uri.
      """
      fileio.makedirs(os.path.dirname(metadata_db_uri))
      connection_config = metadata_store_pb2.ConnectionConfig()
      connection_config.sqlite.filename_uri = metadata_db_uri
      connection_config.sqlite.connection_mode = (
          metadata_store_pb2.SqliteMetadataSourceConfig.READWRITE_OPENCREATE
      )
      return connection_config
  
imports: import collections
  import copy
  import hashlib
  import itertools
  import os
  import random
  import time
  import types
  from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
  import absl
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types
  from tfx.orchestration.portable.mlmd import event_lib
  from tfx.types import artifact
  from tfx.types import artifact_utils
  import ml_metadata
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: sqlite_metadata_connection_config(metadata_db_uri) and returns: connection_config