code: def _flatten_containers(inputs):
      """Flatten containers into a single tuple of arrays.
  
      Returns a flattened tuple of arrays and the indices of the arrays in
      the original containers.
      """
      if ivy.is_array(inputs) or ivy.is_ivy_container(inputs):
          inputs = (inputs,)
      values = []
      ret_idxs = []
      for idx, input in enumerate(inputs):
          if isinstance(input, ivy.Container):
              grad_arr_idxs = ivy.nested_argwhere(
                  input, lambda x: ivy.is_array(x)
              )
              grad_arr_values = ivy.multi_index_nest(
                  input, grad_arr_idxs
              )
              values.extend(grad_arr_values)
              ret_idxs.append(grad_arr_idxs)
          elif ivy.is_array(input):
              values.append(input)
              ret_idxs.append(None)
      return tuple(values), ret_idxs
  
imports: from typing import Sequence, Union, Optional, Tuple, Callable
  import numpy
  import itertools
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, inputs_to_ivy_arrays, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 15 for calling a global function with example usage: _flatten_containers(inputs) and returns: tuple,  ret_idxs