code: def map_nest_at_index(
      nest: Union[
          ivy.Array, ivy.NativeArray, ivy.Container, Dict, List
      ],
      index: Sequence[Union[str, int]],
      fn: Callable[[Any], Any],
      /,
      shallow: bool = True,
      _result: Union[
          ivy.Array, ivy.NativeArray, ivy.Container, Dict, List
      ] = None,
  ) -> Union[
      ivy.Array, ivy.NativeArray, ivy.Container, Dict, List, Tuple
  ]:
      """Map a function to the value of a nested item at a specified index.
  
      Parameters
      ----------
      nest
          The nested object to update.
      index
          A linear sequence of indices for the index at which to update.
      fn
          The function to perform on the nested value at the given index.
      shallow
          Whether to inplace update the input nest or not
          Only works if nest is a mutable type. Default is ``True``.
      _result
          Placeholder for the result of the update. do not set this parameter.
  
      Returns
      -------
      ret
          nest with applicable of fn on given index.
  
      Examples
      --------
      With :class:`ivy.Array` inputs:
  
      >>> x = ivy.array([[1., 2.], [3., 4.]])
      >>> y = (1, 1)
      >>> z = lambda a: a + 1.
      >>> ivy.map_nest_at_index(x, y, z)
      >>> print(x)
      ivy.array([[1., 2.], [3., 5.]])
  
      >>> x = ivy.array([1., 2., 3., 4.])
      >>> y = [1]
      >>> z = lambda a: a + 3.
      >>> ivy.map_nest_at_index(x, y, z)
      >>> print(x)
      ivy.array([1., 5., 3., 4.])
  
      With :code:`Dict` input:
  
      >>> x = {1 : [1, [2, 3]], 2: (4, 5)}
      >>> y = (1, 1)
      >>> z = lambda _: 2
      >>> ivy.map_nest_at_index(x, y, z)
      >>> print(x)
      {1: [1, 2], 2: (4, 5)}
  
      With :code:`List` inputs:
  
      >>> x = [['a', 'b', 'c'],
      ...      ['d', 'e', 'f'],
      ...      ['g', ['h', 'i']]]
      >>> y = (2, 1, 0)
      >>> z = lambda a: a + 'H'
      >>> ivy.map_nest_at_index(x, y, z)
      >>> print(x)
      [['a','b','c'],['d','e','f'],['g',['hH','i']]]
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([1., 2.]) , b=ivy.array([4., 5.]))
      >>> y = ('b',)
      >>> z = lambda _: ivy.array([3., 4.])
      >>> ivy.map_nest_at_index(x, y, z)
      >>> print(x)
      {
          a: ivy.array([1., 2.]),
          b: ivy.array([3., 4.])
      }
      """
      is_tuple = isinstance(nest, tuple)
      nest_type = type(nest) if is_tuple else lambda x: x
      if _result is None:
          if shallow:
              _result = nest_type(nest)
          else:
              _result = copy_nest(nest, include_derived=True)
      _result = list(_result) if is_tuple else _result
      if len(index) == 1:
          ret = fn(nest[index[0]])
          if shallow:
              try:
                  nest[index[0]] = ret
              except TypeError:
                  pass
          _result[index[0]] = ret
      else:
          _result[index[0]] = map_nest_at_index(
              nest[index[0]], index[1:], fn, shallow, _result[index[0]]
          )
      try:
          _result = nest_type(_result)
      except TypeError:
          try:
              _result = nest_type(*_result)
          except TypeError:
              pass
      return _result
  
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 5 for calling a global function with example usage: map_nest_at_index(shallow, _result) and returns: _result