code: def _canonicalize_axis(axis, ndim):
      if not -ndim <= axis < ndim:
          raise ivy.utils.exceptions.IvyException(
              f"axis {axis} is out of bounds for array of dimension {ndim}"
          )
      if axis < 0:
          axis = axis + ndim
      return axis
  
imports: import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_supported_dtypes
label_desc: Use image node_id 2 for calling a global function with example usage: _canonicalize_axis(axis, ndim) and returns: axis