code: def ndenumerate(
      input: Iterable,
  ) -> Generator:
      """Multidimensional index iterator.
  
      Parameters
      ----------
      input
          Input array to iterate over.
  
      Returns
      -------
      ret
          An iterator yielding pairs of array coordinates and values.
  
      Examples
      --------
      >>> a = ivy.array([[1, 2], [3, 4]])
      >>> for index, x in ivy.ndenumerate(a):
      >>>     print(index, x)
      (0, 0) 1
      (0, 1) 2
      (1, 0) 3
      (1, 1) 4
      """
  
      def _ndenumerate(input):
          if ivy.is_ivy_array(input) and input.shape == ():
              yield (), ivy.to_scalar(input)
          else:
              i = [range(k) for k in input.shape]
              for idx in _iter_product(*i):
                  yield idx, input[idx]
  
      input = input if ivy.is_ivy_array(input) else ivy.array(input)
      return _ndenumerate(input)
  
imports: from typing import Union, Tuple, Optional, Sequence, Iterable, Generator
  import warnings
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.utils.exceptions import handle_exceptions
  from ivy.func_wrapper import outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_out_argument, infer_dtype, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_backend_invalid, handle_array_function
label_desc: Use image node_id 9 for calling a global function with example usage: ndenumerate(input) and returns: _ndenumerate