code: def test_labelencoder_fit_transform_cupy_numpy(
      length, cardinality, dtype
  ):
      """Try encoding the cupy array"""
      x = cp.random.choice(cardinality, (length,))
      if dtype == "numpy":
          x = x.get()
      encoded = LabelEncoder().fit_transform(x)
  
      x_arr = _array_to_similarity_mat(x)
      encoded_arr = _array_to_similarity_mat(encoded.values)
      if dtype == "numpy":
          encoded_arr = encoded_arr.get()
      assert ((encoded_arr == encoded_arr.T) == (x == x_arr.T)).all()
  
file_path: cuml/python/cuml/tests/test_label_encoder.py
imports: from cuml.common.exceptions import NotFittedError
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.preprocessing.LabelEncoder import LabelEncoder
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 11 for calling a global function with example usage: test_labelencoder_fit_transform_cupy_numpy(length, cardinality, dtype) without return types