code: def _unique(
      ar: Array,
      axis: int,
      return_index: bool = False,
      return_inverse: bool = False,
      return_counts: bool = False,
      equal_nan: bool = True,
      size: int | None = None,
      fill_value: ArrayLike | None = None,
      return_true_size: bool = False,
  ) -> Array | tuple[Array, ...]:
      """
      Find the unique elements of an array along a particular axis.
      """
      axis = canonicalize_axis(axis, ar.ndim)
  
      if ar.shape[axis] == 0 and size and fill_value is None:
          raise ValueError(
              "jnp.unique: for zero-sized input with nonzero size argument, fill_value must be specified"
          )
  
      aux, mask, perm = _unique_sorted_mask(ar, axis, equal_nan)
      if size is None:
          ind = core.concrete_or_error(
              None,
              mask,
              "The error arose in jnp.unique(). " + UNIQUE_SIZE_HINT,
          )
      else:
          ind = nonzero(mask, size=size)[0]
      result = aux[ind] if aux.size else aux
      if size is not None and fill_value is not None:
          fill_value = asarray(fill_value, dtype=result.dtype)
          if result.shape[0]:
              valid = lax.expand_dims(
                  arange(size) < mask.sum(),
                  tuple(range(1, result.ndim)),
              )
              result = where(valid, result, fill_value)
          else:
              result = full_like(
                  result, fill_value, shape=(size, *result.shape[1:])
              )
      result = moveaxis(result, 0, axis)
  
      ret: tuple[Array, ...] = (result,)
      if return_index:
          if aux.size:
              ret += (perm[ind],)
          else:
              ret += (perm,)
      if return_inverse:
          if aux.size:
              imask = cumsum(mask) - 1
              inv_idx = zeros(
                  mask.shape,
                  dtype=dtypes.canonicalize_dtype(dtypes.int_),
              )
              inv_idx = inv_idx.at[perm].set(imask)
          else:
              inv_idx = zeros(ar.shape[axis], dtype=int)
          if ar.ndim > 1:
              inv_idx = lax.expand_dims(
                  inv_idx,
                  [i for i in range(ar.ndim) if i != axis],
              )
          ret += (inv_idx,)
      if return_counts:
          if aux.size:
              if size is None:
                  idx = append(nonzero(mask)[0], mask.size)
              else:
                  idx = nonzero(mask, size=size + 1)[0]
                  idx = idx.at[1:].set(
                      where(idx[1:], idx[1:], mask.size)
                  )
              ret += (diff(idx),)
          elif ar.shape[axis]:
              ret += (
                  array(
                      [ar.shape[axis]],
                      dtype=dtypes.canonicalize_dtype(dtypes.int_),
                  ),
              )
          else:
              ret += (empty(0, dtype=int),)
      if return_true_size:
          # Useful for internal uses of unique().
          ret += (mask.sum(),)
      return ret[0] if len(ret) == 1 else ret
  
imports: from __future__ import annotations
  from functools import partial
  import math
  import operator
  from textwrap import dedent
  from typing import cast, NamedTuple
  import numpy
  from jax import jit
  from jax import lax
  from jax._src import core
  from jax._src import dtypes
  from jax._src.lax import lax
  from jax._src.numpy.lax_numpy import append, arange, array, asarray, concatenate, diff, empty, full_like, lexsort, moveaxis, nonzero, ones, ravel, sort, where, zeros
  from jax._src.numpy.reductions import any, cumsum
  from jax._src.numpy.ufuncs import isnan
  from jax._src.numpy.util import check_arraylike, _wraps
  from jax._src.util import canonicalize_axis
  from jax._src.typing import Array, ArrayLike
label_desc: Use image node_id 9 for calling a global function with example usage: _unique(ar, axis, return_index, return_inverse, return_counts, equal_nan, size, fill_value, return_true_size) and returns: unknown