docstr: Helper method for testInDefun.
docstr_tok: ["Helper","method","for","testInDefun","."]
code: def _create_control_flow(self, expect_in_defun):
      """Helper method for testInDefun."""
  
      def body(i):
          def branch():
              self.assertEqual(
                  control_flow_util_v2.in_defun(), expect_in_defun
              )
              return i + 1
  
          return cond.cond(
              constant_op.constant(True), branch, lambda: 0
          )
  
      return while_loop.while_loop(
          lambda i: i < 4, body, [constant_op.constant(0)]
      )
  
file_path: tensorflow/tensorflow/python/kernel_tests/control_flow/control_flow_util_v2_test.py
imports: from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import control_flow_util_v2
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the ControlFlowUtilV2Test obj's underlying member method code with example usage: obj._create_control_flow(expect_in_defun) and returns: while_loop, cond, unknown