code: def _unravel_loop_index(shape, uint_t="unsigned int"):
      """
      declare a multi-index array in_coord and unravel the 1D index, i into it.
      This code assumes that the array is a C-ordered array.
      """
      ndim = len(shape)
      code = [
          f"""
          {uint_t} in_coord[{ndim}];
          {uint_t} s, t, idx = i;"""
      ]
      for j in range(ndim - 1, 0, -1):
          code.append(
              f"""
          s = {shape[j]};
          t = idx / s;
          in_coord[{j}] = idx - t * s;
          idx = t;"""
          )
      code.append(
          """
          in_coord[0] = idx;"""
      )
      return "\n".join(code)
  
file_path: cupy/cupyx/scipy/ndimage/_interp_kernels.py
imports: import numpy
  import cupy
  import cupy._core.internal
  from cupyx.scipy.ndimage import _spline_prefilter_core
  from cupyx.scipy.ndimage import _spline_kernel_weights
  from cupyx.scipy.ndimage import _util
label_desc: Use image node_id 8 for calling a global function with example usage: _unravel_loop_index(shape, uint_t) and returns: str