code: def test_loop_initializing_invariant_variable_illegal(self):
      with self.assertRaises(UnboundLocalError):
          tf.function(loop_initializing_invariant_variable)(0)
      with self.assertRaisesRegex(
          tf.errors.InvalidArgumentError,
          "loop must iterate at least once",
      ):
          tf.function(loop_initializing_invariant_variable)(
              tf.constant(0)
          )
  
imports: import itertools
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.python.autograph.tests import reference_test_base
label_desc: Use image node_id 17 for calling the NestedControlFlowTest obj's underlying member method code with example usage: obj.test_loop_initializing_invariant_variable_illegal() without return types