code: def test_encode_util(values, expected):
      uniques = _unique(values)
      assert_array_equal(uniques, expected)
  
      result, encoded = _unique(values, return_inverse=True)
      assert_array_equal(result, expected)
      assert_array_equal(encoded, np.array([1, 0, 2, 0, 2]))
  
      encoded = _encode(values, uniques=uniques)
      assert_array_equal(encoded, np.array([1, 0, 2, 0, 2]))
  
      result, counts = _unique(values, return_counts=True)
      assert_array_equal(result, expected)
      assert_array_equal(counts, np.array([2, 1, 2]))
  
      result, encoded, counts = _unique(
          values, return_inverse=True, return_counts=True
      )
      assert_array_equal(result, expected)
      assert_array_equal(encoded, np.array([1, 0, 2, 0, 2]))
      assert_array_equal(counts, np.array([2, 1, 2]))
  
file_path: scikit-learn/sklearn/utils/tests/test_encode.py
imports: import pickle
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn.utils._encode import _check_unknown, _encode, _get_counts, _unique
label_desc: Use image node_id 1 for calling a global function with example usage: test_encode_util(values, expected) without return types