code: def all_nested_indices(
      nest: Union[
          List, Tuple, Dict, ivy.Array, ivy.NativeArray, ivy.Container
      ] = None,
      /,
      include_nests: bool = False,
      _index: Optional[Union[int, Sequence[int]]] = None,
      _base: bool = True,
  ) -> List:
      """Return indices of all the elements in nest.
  
      Parameters
      ----------
      nest
          The nest to check the leaves of.
      include_nests
          Whether to also include indices of the nests themselves, not only
          leaves. Default is ``False``.
      _index
          The indices detected so far. None at the beginning. Used internally,
          do not set manually.
      _base
          Whether the current function call is the first function call in the
          recursive stack. Used internally, do not set manually.
  
      Returns
      -------
      ret
          A set of indices of all elements in nest
  
      Examples
      --------
      With :code:`List` input:
  
      >>> x = [189, [863, 672], [264, 384]]
      >>> y = ivy.all_nested_indices(x)
      >>> print(y)
      [[0], [1, 0], [1, 1], [2, 0], [2, 1]]
  
      With :code:`Tuple` input:
  
      >>> x = (189, (863, 672), (264, 384))
      >>> y = ivy.all_nested_indices(x, include_nests=True)
      >>> print(y)
      [[0], [1, 0], [1, 1], [1], [2, 0], [2, 1], [2]]
  
      With :code:`Dict` input:
  
      >>> x = {'a': 2., 'b': [6., [15., 9.]], 'c': (7., 56.)}
      >>> y = ivy.all_nested_indices(x)
      >>> print(y)
      [['a'], ['b', 0], ['b', 1, 0], ['b', 1, 1], ['c', 0], ['c', 1]]
  
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([[True, False], [False, False]])
      >>> y = ivy.all_nested_indices(x)
      >>> print(y)
      [[]]
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([412, 948, 482]), b=ivy.array([168, 674, 341]))
      >>> y = ivy.all_nested_indices(x)
      >>> print(y)
      [['a'], ['b']]
      """
      _index = [] if _index is None else _index
      if isinstance(nest, (tuple, list)):
          _indices = [
              all_nested_indices(
                  item,
                  include_nests,
                  _index + [i],
                  False,
              )
              for i, item in enumerate(nest)
          ]
          _indices = [idx for idxs in _indices if idxs for idx in idxs]
          if include_nests:
              _indices.append(_index)
      elif isinstance(nest, dict):
          _indices = [
              all_nested_indices(v, include_nests, _index + [k], False)
              for k, v in nest.items()
          ]
          _indices = [idx for idxs in _indices if idxs for idx in idxs]
          if include_nests:
              _indices.append(_index)
      else:
          return [_index]
      return [index for index in _indices if index]
  
imports: from builtins import map
  from typing import Callable, Any, Union, List, Tuple, Optional, Dict, Iterable, Sequence
  from collections import UserDict, OrderedDict
  import ivy
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 12 for calling a global function with example usage: all_nested_indices(include_nests, _index, _base) and returns: unknown, list