code: def testRegisterContextAndSetParentChildRelationship(self):
      with metadata.Metadata(
          connection_config=self._connection_config
      ) as m:
          parent_context = context_lib.register_context_if_not_exists(
              metadata_handle=m,
              context_type_name="my_context_type",
              context_name="parent_context",
          )
          context_1 = context_lib.register_context_if_not_exists(
              metadata_handle=m,
              context_type_name="my_context_type",
              context_name="context_1",
          )
          context_2 = context_lib.register_context_if_not_exists(
              metadata_handle=m,
              context_type_name="my_context_type",
              context_name="context_2",
              parent_contexts=[parent_context],
          )
  
          context_1_parents = m.store.get_parent_contexts_by_context(
              context_1.id
          )
          self.assertEqual([], context_1_parents)
          context_2_parents = m.store.get_parent_contexts_by_context(
              context_2.id
          )
          self.assertLen(context_2_parents, 1)
          self.assertEqual(parent_context.id, context_2_parents[0].id)
  
file_path: tfx/tfx/orchestration/portable/mlmd/context_lib_test.py
imports: import os
  import tensorflow
  from tfx.orchestration import metadata
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import test_case_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling the ContextLibTest obj's underlying member method code with example usage: obj.testRegisterContextAndSetParentChildRelationship() without return types