code: def testPreventGradient(self):
      def f(x):
          return custom_gradient.prevent_gradient(x, "No gradient")
  
      _ = f(1.0)
  
      with self.assertRaisesRegex(LookupError, "No gradient"):
          tfp_gradient.value_and_gradient(f, (1.0))
  
file_path: probability/tensorflow_probability/python/internal/custom_gradient_test.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 4 for calling the CustomGradientTest obj's underlying member method code with example usage: obj.testPreventGradient() and returns: custom_gradient