code: def unique_all(
      x: np.ndarray,
      /,
      *,
      axis: Optional[int] = None,
      by_value: bool = True,
  ) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
      Results = namedtuple(
          "Results",
          ["values", "indices", "inverse_indices", "counts"],
      )
  
      values, indices, inverse_indices, counts = np.unique(
          x,
          return_index=True,
          return_counts=True,
          return_inverse=True,
          axis=axis,
      )
  
      nan_count = np.sum(np.isnan(x)).item()
      if (nan_count > 1) & (np.sum(np.isnan(values)).item() == 1):
          counts[np.where(np.isnan(values))[0]] = 1
          counts = np.append(
              counts, np.full(fill_value=1, shape=(nan_count - 1,))
          )
  
          values = np.append(
              values,
              np.full(fill_value=np.nan, shape=(nan_count - 1,)),
              axis=0,
          )
          nan_idx = np.where(np.isnan(x.flatten()))[0]
          indices = np.concatenate((indices[:-1], nan_idx), axis=0)
  
      if not by_value:
          sort_idx = np.argsort(indices)
          values = np.take(values, sort_idx, axis=axis)
          counts = np.take(counts, sort_idx)
          indices = np.take(indices, sort_idx)
          inv_sort_idx = ivy.current_backend().invert_permutation(
              sort_idx
          )
          inverse_indices = np.vectorize(
              lambda y: np.take(inv_sort_idx, y)
          )(inverse_indices)
  
      return Results(
          values.astype(x.dtype),
          indices,
          inverse_indices,
          counts,
      )
  
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 1 for calling a global function with example usage: unique_all() and returns: Results