code: def _encode_numpy(
      values, uniques=None, encode=False, check_unknown=True
  ):
      # only used in _encode below, see docstring there for details
      if uniques is None:
          if encode:
              uniques, encoded = np.unique(values, return_inverse=True)
              return uniques, encoded
          else:
              # unique sorts
              return np.unique(values)
      if encode:
          if check_unknown:
              diff = _encode_check_unknown(values, uniques)
              if diff:
                  raise ValueError(
                      "y contains previously unseen labels: %s".format(
                          str(diff)
                      )
                  )
          encoded = np.searchsorted(uniques, values)
          return uniques, encoded
      else:
          return uniques
  
file_path: h2o-3/h2o-py/tests/pyunit_utils/sklearn_multinomial_auc_method.py
imports: import numpy
  from itertools import combinations
  from functools import partial
  from sklearn.utils import column_or_1d, check_consistent_length, check_array
  from sklearn.preprocessing import label_binarize
  from sklearn.metrics import auc, roc_curve
  from sklearn.utils.multiclass import type_of_target
label_desc: Use image node_id 2 for calling a global function with example usage: _encode_numpy(values, uniques, encode, check_unknown) and returns: uniques,  encoded, uniques, uniques,  encoded, np