class_docstr: Helper class to handle metadata I/O.
  
  Not thread-safe without external synchronisation.
code: def __enter__(self) -> "Metadata":
      # TODO(ruoyu): Establishing a connection pool instead of newing
      # a connection every time. Until then, check self._store before usage
      # in every method.
      connection_error = None
      for _ in range(_MAX_INIT_RETRY):
          try:
              self._store = mlmd.MetadataStore(self._connection_config)
          except RuntimeError as err:
              # MetadataStore could raise Aborted error if multiple concurrent
              # connections try to execute initialization DDL in database.
              # This is safe to retry.
              connection_error = err
              time.sleep(random.random())
              continue
          else:
              self._users += 1
              return self
  
      raise RuntimeError(
          "Failed to establish connection to Metadata storage with error: %s"
          % connection_error
      )
  
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 2 for calling the Metadata obj's underlying member method code with example usage: obj.__enter__() and returns: self