code: def cummax(
      x: JaxArray,
      /,
      *,
      axis: int = 0,
      exclusive: bool = False,
      reverse: bool = False,
      dtype: Optional[jnp.dtype] = None,
      out: Optional[JaxArray] = None,
  ) -> Tuple[JaxArray, JaxArray]:
      if x.dtype in (jnp.complex128, jnp.complex64):
          x = x.real
  
      if exclusive or (reverse and exclusive):
          if exclusive and reverse:
              indices = __find_cummax_indices(
                  jnp.flip(x, axis=axis), axis=axis
              )
              x = jlax.cummax(jnp.flip(x, axis=axis), axis=axis)
              x, indices = jnp.swapaxes(x, axis, -1), jnp.swapaxes(
                  indices, axis, -1
              )
              x, indices = jnp.concatenate(
                  (jnp.zeros_like(x[..., -1:]), x[..., :-1]), -1
              ), jnp.concatenate(
                  (
                      jnp.zeros_like(indices[..., -1:]),
                      indices[..., :-1],
                  ),
                  -1,
              )
              x, indices = jnp.swapaxes(x, axis, -1), jnp.swapaxes(
                  indices, axis, -1
              )
              res, indices = jnp.flip(x, axis=axis), jnp.flip(
                  indices, axis=axis
              )
          elif exclusive:
              x = jnp.swapaxes(x, axis, -1)
              x = jnp.concatenate(
                  (jnp.zeros_like(x[..., -1:]), x[..., :-1]), -1
              )
              x = jnp.swapaxes(x, axis, -1)
              indices = __find_cummax_indices(x, axis=axis)
              res = jlax.cummax(x, axis=axis)
          return res, indices
  
      if reverse:
          y = jnp.flip(x, axis=axis)
          indices = __find_cummax_indices(y, axis=axis)
          indices = jnp.flip(indices, axis=axis)
      else:
          indices = __find_cummax_indices(x, axis=axis)
      return jlax.cummax(x, axis, reverse=reverse), indices
  
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 11 for calling a global function with example usage: cummax() and returns: jlax,  indices, res,  indices