code: def for_loop(
      iterable: Iterable[Any],
      body_fn: Callable,
      vars: Iterable[Union[ivy.Array, ivy.NativeArray]],
  ):
      """Loops over an iterable, passing the current iteration along with a tuple
      of variables into the provided body function.
  
      Parameters
      ----------
      iterable
          The iterable to loop over.
      body_fn
          A function to call each iteration, first taking the iterator value
          and then a tuple of extra parameters.
      vars
          Extra parameters to be passed to body_fn.
  
      Returns
      -------
      ret
          The loop's return value (if any).
  
      Example
      ----
      >>> def body_fn(k, args):
      >>>     print(k+1)
      >>>     return args
      >>>
      >>> lst = [5,6]
      >>>
      >>> ivy.for_loop(lst, body_fn, ())
      5
      6
      """
      iterator = iterable.__iter__()
  
      vars_dict = _tuple_to_dict(vars)
  
      def test_fn(iterator, original_body, vars_dict):
          try:
              val = iterator.__next__()
          except StopIteration:
              return False
  
          vars_tuple = original_body(val, _dict_to_tuple(vars_dict))
  
          for k in range(len(vars_tuple)):
              vars_dict[k] = vars_tuple[k]
  
          return True
  
      def empty_function(iterator, original_body, vars_dict):
          return (iterator, original_body, vars_dict)
  
      packed_vars = (iterator, body_fn, vars_dict)
  
      return _dict_to_tuple(
          while_loop(test_fn, empty_function, packed_vars)[2]
      )
  
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 3 for calling a global function with example usage: for_loop(iterable, body_fn, vars) and returns: _dict_to_tuple, True, iterator,  original_body,  vars_dict, False