code: def nested_argwhere(
      nest: Iterable,
      fn: Callable,
      check_nests: bool = False,
      to_ignore: Optional[Union[type, Tuple[type]]] = None,
      _index: Optional[List] = None,
      _base: bool = True,
      stop_after_n_found: Optional[int] = None,
  ) -> Union[Iterable, bool]:
      """Check the leaf nodes of nested x via function fn, and returns all nest
      indices where the method evaluates as True.
  
      Parameters
      ----------
      nest
          The nest to check the leaves of.
      fn
          The condition function, returning True or False.
      check_nests
          Whether to also check the nests for the condition, not only nest leaves.
          Default is ``False``.
      to_ignore
          Types to ignore when deciding whether to go deeper into the nest or not
      _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.
      stop_after_n_found
          to stop after some needed indices are found.
  
      Returns
      -------
      ret
          A set of indices for the nest where the function evaluated as True.
  
      Examples
      --------
      With :code:`List` input:
  
      >>> nest = [[[1, -2, 3], 19], [[9, -36, 80], -10.19]]
      >>> fun = ivy.abs
      >>> nested_indices = ivy.nested_argwhere(nest, fn=fun)
      >>> print(nested_indices)
      [
          [0, 0, 0], [0, 0, 1],
          [0, 0, 2], [0, 1],
          [1, 0, 0], [1, 0, 1],
          [1, 0, 2], [1, 1]
      ]
  
  
      With :code:`Tuple` input:
  
      >>> nest = ([-5, 9, 2], [0.3, 4.])
      >>> fun = ivy.abs
      >>> nested_indices = ivy.nested_argwhere(nest, fn=fun, stop_after_n_found=4)
      >>> print(nested_indices)
      [[0, 0], [0, 1], [0, 2], [1, 0]]
  
      With :code:`Dict` input:
  
      >>> nest={'a': [2., 0.6, -2.], 'b': [1., 4., 1.9], 'c': [9.4]}
      >>> fun = ivy.abs
      >>> nested_indices = ivy.nested_argwhere(nest, fn=fun)
      >>> print(nested_indices)
      [
          ['a', 0], ['a', 1],
          ['a', 2], ['b', 0],
          ['b', 1], ['b', 2],
          ['c', 0]
      ]
      """
      to_ignore = ivy.default(to_ignore, ())
      _index = [] if _index is None else _index
      if isinstance(nest, (tuple, list)) and not isinstance(
          nest, to_ignore
      ):
          n = 0
          _indices = []
          for i, item in enumerate(nest):
              ind = (
                  nested_argwhere(
                      item,
                      fn,
                      check_nests,
                      to_ignore,
                      _index + [i],
                      False,
                      stop_after_n_found - n,
                  )
                  if stop_after_n_found is not None
                  else nested_argwhere(
                      item,
                      fn,
                      check_nests,
                      to_ignore,
                      _index + [i],
                      False,
                      None,
                  )
              )
              if stop_after_n_found is not None and ind:
                  if n >= stop_after_n_found:
                      break
                  n += len(ind)
              _indices += [ind]
              if (
                  stop_after_n_found is not None
                  and n >= stop_after_n_found
              ):
                  break
          _indices = [idx for idxs in _indices if idxs for idx in idxs]
          if check_nests and fn(nest):
              _indices.append(_index)
      elif (isinstance(nest, (dict, UserDict))) and not isinstance(
          nest, to_ignore
      ):
          n = 0
          _indices = []
          for k, v in nest.items():
              ind = (
                  nested_argwhere(
                      v,
                      fn,
                      check_nests,
                      to_ignore,
                      _index + [k],
                      False,
                      stop_after_n_found - n,
                  )
                  if stop_after_n_found is not None
                  else nested_argwhere(
                      v,
                      fn,
                      check_nests,
                      to_ignore,
                      _index + [k],
                      False,
                      None,
                  )
              )
              if stop_after_n_found is not None and ind:
                  if n >= stop_after_n_found:
                      break
                  n += len(ind)
              _indices += [ind]
          _indices = [idx for idxs in _indices if idxs for idx in idxs]
          if check_nests and fn(nest):
              _indices.append(_index)
      else:
          cond_met = fn(nest)
          if cond_met:
              return [_index]
          return False
      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 11 for calling a global function with example usage: nested_argwhere(nest, fn, check_nests, to_ignore, _index, _base, stop_after_n_found) and returns: unknown, False, list