code: def test_labelencoder_transform(length, cardinality):
      """Try fitting and then encoding a small subset of the df"""
      df = cudf.Series(np.random.choice(cardinality, (length,)))
      le = LabelEncoder().fit(df)
      assert le._fitted
  
      subset = df.iloc[0 : df.shape[0] // 2]
      encoded = le.transform(subset)
  
      subset_arr = _df_to_similarity_mat(subset)
      encoded_arr = _df_to_similarity_mat(encoded)
      assert (
          (encoded_arr == encoded_arr.T) == (subset_arr == subset_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 3 for calling a global function with example usage: test_labelencoder_transform(length, cardinality) without return types