code: def while_loop(
      test_fn: Callable,
      body_fn: Callable,
      vars: Dict[str, Union[ivy.Array, ivy.NativeArray]],
  ) -> Any:
      """Take a test function, a body function and a set of variables as input.
      The body function is executed repeatedly while the test function returns
      True.
  
      Parameters
      ----------
      test_fn
          A callable function that returns a boolean value representing whether the
          loop should continue.
      body_fn
          A callable function to be executed repeatedly while the test function returns
          True.
      vars
          Additional variables to be passed to the functions.
  
      Returns
      -------
      ret
          The final result of executing the body function.
  
      Examples
      --------
      >>> i = 0
      >>> test_fn = lambda i: i < 3
      >>> body_fn = lambda i: i + 1
      >>> result = ivy.while_loop(test_fn, body_fn, vars= (i,))
      >>> print(result)
      (3,)
  
      >>> i = 0
      >>> j = 1
      >>> test_fn = lambda i, j: i < 3
      >>> body_fn = lambda i, j: (i + 1, j * 2)
      >>> vars = (i, j)
      >>> result = ivy.while_loop(test_fn, body_fn, vars=vars)
      >>> print(result)
      (3, 8)
      """
  
      @to_native_arrays_and_back
      @handle_array_like_without_promotion
      def _while_loop(test_fn, body_fn, **vars):
          return current_backend().while_loop(test_fn, body_fn, vars)
  
      return _while_loop(test_fn, body_fn, **vars)
  
file_path: ivy/ivy/functional/ivy/control_flow_ops.py
imports: from typing import Union, Callable, Any, Iterable, Dict
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_like_without_promotion, to_native_arrays_and_back
label_desc: Use image node_id 2 for calling a global function with example usage: while_loop(test_fn, body_fn, vars) and returns: _while_loop, current_backend