code: def test_add_child_parent_bad_key_raises(self):
      encoder = core_encoder.EncoderComposer(
          test_utils.TimesTwoEncodingStage()
      )
      with self.assertRaises(KeyError):
          encoder.add_child(
              test_utils.PlusOneEncodingStage(), "___bad_key"
          )
      with self.assertRaises(KeyError):
          encoder.add_parent(
              test_utils.PlusOneEncodingStage(), "___bad_key"
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import core_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import encoding_stage
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 5 for calling the EncoderComposerTest obj's underlying member method code with example usage: obj.test_add_child_parent_bad_key_raises() without return types