code: def _nanargminmax(a, axis=None):
      # check nans
      nans = ivy.isnan(a).astype(ivy.bool)
      # replace nans with inf
      a = ivy.where(nans, ivy.inf, a)
      if nans is not None:
          nans = ivy.all(nans, axis=axis)
          if ivy.any(nans):
              raise ivy.utils.exceptions.IvyError(
                  "All-NaN slice encountered"
              )
      return a
  
file_path: ivy/ivy/functional/frontends/numpy/sorting_searching_counting/searching.py
imports: import ivy
  from ivy.functional.frontends.numpy import promote_types_of_numpy_inputs
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, from_zero_dim_arrays_to_scalar, handle_numpy_out
label_desc: Use image node_id 1 for calling a global function with example usage: _nanargminmax(a, axis) and returns: a