code: def unique_inverse(
      x: np.ndarray,
      /,
      *,
      axis: Optional[int] = None,
  ) -> Tuple[np.ndarray, np.ndarray]:
      Results = namedtuple("Results", ["values", "inverse_indices"])
      values, inverse_indices = np.unique(
          x, return_inverse=True, axis=axis
      )
      nan_count = np.count_nonzero(np.isnan(x))
      if nan_count > 1:
          values = np.append(
              values, np.full(nan_count - 1, np.nan), axis=axis
          ).astype(x.dtype)
      inverse_indices = np.reshape(inverse_indices, x.shape)
      return Results(values, inverse_indices)
  
file_path: ivy/ivy/functional/backends/numpy/set.py
imports: import numpy
  from typing import Tuple, Optional
  from collections import namedtuple
  from packaging import version
  import ivy
label_desc: Use image node_id 3 for calling a global function with example usage: unique_inverse() and returns: Results