code: def testRegistration(self):
      class MyDist(normal.Normal):
          pass
  
      # Register KL to a lambda that spits out the name parameter
      @kullback_leibler.RegisterKL(MyDist, MyDist)
      def _kl(
          a, b, name=None
      ):  # pylint: disable=unused-argument,unused-variable
          return name
  
      a = MyDist(loc=0.0, scale=1.0)
      self.assertEqual(
          "OK", kullback_leibler.kl_divergence(a, a, name="OK")
      )
  
      # Check that everything still works for an object `d` for which
      # `d.__class__` is a registered type but `type(d)` is not registered.
      w_a = getattr(wrapt, "ObjectProxy", lambda x: x)(a)
      self.assertTrue(
          wrapt is None or type(w_a) != type(a)
      )  # pylint: disable=unidiomatic-typecheck
      self.assertEqual(a.__class__, w_a.__class__)
      self.assertEqual(
          "OK", kullback_leibler.kl_divergence(a, w_a, name="OK")
      )
      self.assertEqual(
          "OK", kullback_leibler.kl_divergence(w_a, a, name="OK")
      )
      self.assertEqual(
          "OK", kullback_leibler.kl_divergence(w_a, w_a, name="OK")
      )
      # NOTE: `Distribution.kl_divergence(other, name)` does not pass the name
      # through to `kullback_leibler.kl_divergence`
      self.assertEqual(
          "KullbackLeibler", a.kl_divergence(w_a, name="OK")
      )
      self.assertEqual(
          "KullbackLeibler", w_a.kl_divergence(a, name="OK")
      )
      self.assertEqual(
          "KullbackLeibler", w_a.kl_divergence(w_a, name="OK")
      )
  
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 1 for calling the KLTest obj's underlying member method code with example usage: obj.testRegistration() and returns: name