code: def test_if_else_var_lifetime(self, c, type_):
      c = type_(c)
      self.assertFunctionMatchesEager(if_else_creates_var, c)
      if type_ is int:
          with self.assertRaisesRegex(UnboundLocalError, "'i'"):
              tf.function(if_else_destroys_var)(c)
      else:
          with self.assertRaisesRegex(
              ValueError, "'i' must also be initialized"
          ):
              tf.function(if_else_destroys_var)(c)
  
imports: import itertools
  import re
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.python.autograph.tests import reference_test_base
label_desc: Use image node_id 4 for calling the ReferenceTest obj's underlying member method code with example usage: obj.test_if_else_var_lifetime(c, type_) without return types