code: def test_handle_unknown(as_array: bool) -> None:
      X = DataFrame({"data": [0, 1]})
      Y = DataFrame({"data": [3, 1]})
  
      if as_array:
          X = X.values
          Y = Y.values
  
      enc = OrdinalEncoder(handle_unknown="error")
      enc = enc.fit(X)
      with pytest.raises(KeyError):
          enc.transform(Y)
  
      enc = OrdinalEncoder(handle_unknown="ignore")
      enc = enc.fit(X)
      encoded = enc.transform(Y)
      if as_array:
          np.isnan(encoded[0, 0])
      else:
          assert pd.isna(encoded.iloc[0, 0])
  
file_path: cuml/python/cuml/tests/test_ordinal_encoder.py
imports: import cupy
  import numpy
  import pandas
  import pytest
  from sklearn.preprocessing import OrdinalEncoder
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.preprocessing import OrdinalEncoder
label_desc: Use image node_id 7 for calling a global function with example usage: test_handle_unknown(as_array) without return types