code: def testRegistrationFailures(self):
      class MyDist(normal.Normal):
          pass
  
      with self.assertRaisesRegexp(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.assertRaisesRegexp(
          ValueError, "has already been registered"
      ):
          kullback_leibler.RegisterKL(MyDist, MyDist)(lambda a, b: None)
  
file_path: probability/tensorflow_probability/python/distributions/kullback_leibler_test.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import test_util
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