code: def while_loop(test_fn, body_fn, vars):
      def body_fn_wrapper(*loop_vars):
          return body_fn(*loop_vars)
  
      def test_fn_wrapper(*loop_vars):
          return test_fn(*loop_vars)
  
      if not vars:
          vars = (0,)
      elif isinstance(vars, dict):
          vars = list(vars.values())
      return tf.while_loop(
          test_fn_wrapper, body_fn_wrapper, loop_vars=vars
      )
  
imports: import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: while_loop(test_fn, body_fn, vars) and returns: tf, body_fn, test_fn