code: def _get_y_and_ret_idxs(
      func_ret, ret_grad_idxs, create_var=False, reshape=True
  ):
      """Get the relevant outputs from the function return value."""
      if (
          ivy.is_ivy_container(func_ret) or ivy.is_array(func_ret)
      ) and ret_grad_idxs == [[0]]:
          ret_grad_idxs = None
      ret_idxs, ret_values = _get_native_variables_and_indices(
          func_ret,
          idxs=ret_grad_idxs,
          create_var=create_var,
          reshape=reshape,
      )
      if ret_values is None or (
          isinstance(ret_values, list) and len(ret_values) == 0
      ):
          return func_ret, {}
      if (
          isinstance(ret_values, list)
          and len(ret_values) == 1
          and ret_grad_idxs is None
      ):
          y = ret_values[0]
      else:
          y = ret_values
      return ret_grad_idxs, y, 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 7 for calling a global function with example usage: _get_y_and_ret_idxs(func_ret, ret_grad_idxs, create_var, reshape) and returns: ret_grad_idxs,  y,  ret_idxs, func_ret,  dict