class_docstr: MLMDConnectionManager manages the connections to MLMD.
  
  It can connect to multiple MLMD databases.
  For each MLMD database it connects, only one connection/channel will be
  created. The connections/channels can be distinguished by the "identifier" of
  the connection config.
  
  The connection sharing begins from the time the manager instance __enter__ and
  ends on the __exit__. Manager can __enter__ multiple times; in such case the
  outermost __enter__ and __exit__ pair matters.
docstr: Gets or creates a memoized MLMD handle for the connection config.
docstr_tok: ["Gets","or","creates","a","memoized","MLMD","handle","for","the","connection","config","."]
code: def get_mlmd_handle(
      self,
      connection_config: Optional[metadata.ConnectionConfigType] = None,
  ) -> metadata.Metadata:
      """Gets or creates a memoized MLMD handle for the connection config."""
      if not self._enter_count:
          raise RuntimeError(
              "MLMDConnectionManager is not entered yet. Please use with statement "
              "first before calling get_mlmd_handle()."
          )
      if connection_config is None:
          connection_config = self._primary_connection_config
      config_id = self._get_identifier(connection_config)
      if config_id in self._mlmd_handle_by_config_id:
          return self._mlmd_handle_by_config_id[config_id]
      result = metadata.Metadata(connection_config)
      self._mlmd_handle_by_config_id[config_id] = result
      self._exit_stack.enter_context(result)
      return result
  
file_path: tfx/tfx/orchestration/mlmd_connection_manager.py
imports: import contextlib
  import types
  from typing import Optional, Type, Union, cast
  from tfx.orchestration import metadata
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 8 for calling the MLMDConnectionManager obj's underlying member method code with example usage: obj.get_mlmd_handle(connection_config) and returns: result, self