code: def raise_exception_in_eager_mode(value):
      def f():
          if tf.executing_eagerly():
              raise_exception()
          return value
  
      return f
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 2 for calling a global function with example usage: raise_exception_in_eager_mode(value) and returns: f, value