code: def __find_cummax_indices(
      x: JaxArray,
      axis: int = 0,
  ) -> JaxArray:
      n, indice, indices = 0, [], []
  
      if isinstance(x[0], JaxArray) and len(x[0].shape) >= 1:
          if axis >= 1:
              for ret1 in x:
                  indice = __find_cummax_indices(ret1, axis=axis - 1)
                  indices.append(indice)
          else:
              z_list = __get_index(x.tolist())
              indices, n1 = x.copy(), {}
              indices = jnp.zeros(
                  jnp.asarray(indices.shape), dtype=x.dtype
              )
              z_list = sorted(z_list, key=lambda i: i[1])
              for y, y_index in z_list:
                  multi_index = y_index
                  if tuple(multi_index[1:]) not in n1:
                      n1[tuple(multi_index[1:])] = multi_index[0]
                      indices = indices.at[y_index].set(multi_index[0])
                  elif (
                      y
                      >= x[
                          tuple(
                              [n1[tuple(multi_index[1:])]]
                              + list(multi_index[1:])
                          )
                      ]
                  ):
                      n1[tuple(multi_index[1:])] = multi_index[0]
                      indices = indices.at[y_index].set(multi_index[0])
                  else:
                      indices = indices.at[y_index].set(
                          n1[tuple(multi_index[1:])]
                      )
      else:
          n, indices = 0, []
          for idx, y in enumerate(x):
              if idx == 0 or x[n] <= y:
                  n = idx
              indices.append(n)
  
      return jnp.asarray(indices, dtype="int64")
  
imports: import jax.numpy
  from typing import Optional, Union, Tuple, Sequence
  from ivy.functional.backends.jax import JaxArray
  import jax.lax
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  from ..statistical import _infer_dtype
label_desc: Use image node_id 12 for calling a global function with example usage: __find_cummax_indices(x, axis) and returns: jnp