code: def testCondAndTensorArrayInDefun(self):
      # TODO(b/132430685): Make test more useful. Also b/129396295, b/127846988
      with self.session(), self.test_scope():
          xla_context = control_flow_ops.XLAControlFlowContext()
          xla_context.Enter()
  
          @def_function.function
          def f():
              ta = tensor_array_ops.TensorArray(
                  dtype=dtypes.float32, size=1
              )
              output = cond.cond(
                  constant_op.constant(True),
                  lambda: ta.write(0, 5.0),
                  lambda: ta.write(0, 10.0),
              )
  
              return output.stack()
  
          output_t = f()
          self.assertAllEqual([5.0], self.evaluate(output_t))
  
          xla_context.Exit()
  
imports: from tensorflow.compiler.tests import xla_test
  from tensorflow.python.client import session
  from tensorflow.python.compiler.xla import xla
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_switch_case
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the CondTest obj's underlying member method code with example usage: obj.testCondAndTensorArrayInDefun() and returns: output