code: def test_onehotencoder_dataframe_with_categories():
      # https://github.com/dask/dask-ml/issues/726
      enc = dask_ml.preprocessing.OneHotEncoder(
          categories=[["a", "b", "c"], ["a", "b"]], sparse_output=False
      )
      ddf = dd.from_pandas(
          pd.DataFrame(
              {"A": ["a", "b", "b", "a"], "B": ["a", "b", "b", "b"]}
          ),
          npartitions=1,
      )
      result = enc.fit_transform(ddf)
      expected = dd.from_pandas(
          pd.DataFrame(
              {
                  "A_a": [1, 0, 0, 1],
                  "A_b": [0, 1, 1, 0],
                  "A_c": [0, 0, 0, 0],
                  "B_a": [1, 0, 0, 0],
                  "B_b": [0, 0, 0, 0],
              }
          ),
          npartitions=1,
      )
      assert_estimator_equal(result, expected)
  
imports: import dask.array
  import dask.dataframe
  import numpy
  import packaging.version
  import pandas
  import pytest
  import scipy.sparse
  import sklearn.preprocessing
  import dask_ml.preprocessing
  from dask_ml._compat import DASK_2_20_0, PANDAS_VERSION
  from dask_ml.utils import assert_estimator_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_onehotencoder_dataframe_with_categories() without return types