code: def nanargmax(a, /, *, axis=None, out=None, keepdims=False):
      if out is not None:
          raise NotImplementedError(
              "The 'out' argument to jnp.nanargmax is not supported."
          )
      nan_mask = ivy.isnan(a)
      if not ivy.any(nan_mask):
          return ivy.argmax(a, axis=axis, keepdims=keepdims)
  
      a = ivy.where(nan_mask, -ivy.inf, a)
      res = ivy.argmax(a, axis=axis, keepdims=keepdims)
      return ivy.where(
          ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res
      )
  
imports: import logging
  import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back
  from ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar
  from ivy.func_wrapper import with_supported_device_and_dtypes, with_unsupported_dtypes
label_desc: Use image node_id 10 for calling a global function with example usage: nanargmax() and returns: ivy, ivy