code: def testRegistrationFailures(self):
      class MyDist(normal.Normal):
          pass
  
      with self.assertRaisesRegex(TypeError, "must be callable"):
          kullback_leibler.RegisterKL(MyDist, MyDist)("blah")
  
      # First registration is OK
      kullback_leibler.RegisterKL(MyDist, MyDist)(lambda a, b: None)
  
      # Second registration fails
      with self.assertRaisesRegex(
          ValueError, "has already been registered"
      ):
          kullback_leibler.RegisterKL(MyDist, MyDist)(lambda a, b: None)
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/distributions/kullback_leibler_test.py
imports: from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.distributions import kullback_leibler
  from tensorflow.python.ops.distributions import normal
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the KLTest obj's underlying member method code with example usage: obj.testRegistrationFailures() without return types