code: def put_parent_context_if_not_exists(
      metadata_handle: metadata.Metadata, parent_id: int, child_id: int
  ) -> None:
      """Puts a ParentContext edge in MLMD if it doesn't already exist.
  
      Args:
        metadata_handle: A handler to access MLMD store.
        parent_id: The id of the parent metadata_store_pb2.Context.
        child_id: The id of the child metadata_store_pb2.Context.
      """
      parent_context = metadata_store_pb2.ParentContext(
          parent_id=parent_id, child_id=child_id
      )
      try:
          metadata_handle.store.put_parent_contexts([parent_context])
      except mlmd_errors.AlreadyExistsError:
          # Ensure idempotence.
          pass
  
file_path: tfx/tfx/orchestration/portable/mlmd/context_lib.py
imports: from typing import List, Optional
  from absl import logging
  from tfx.dsl.compiler import constants
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration.portable.mlmd import common_utils
  from tfx.utils import metrics_utils
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import telemetry_utils
  import ml_metadata
  from ml_metadata import errors
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: put_parent_context_if_not_exists(metadata_handle, parent_id, child_id) without return types