code: def test_basic_dataframe(sparse_output, method, dask_data, dtype):
      a = sklearn.preprocessing.OneHotEncoder(
          sparse_output=sparse_output, dtype=dtype
      )
      b = dask_ml.preprocessing.OneHotEncoder(
          sparse_output=sparse_output, dtype=dtype
      )
  
      if method == "fit":
          a.fit(df)
          b.fit(dask_data)
          expected = a.transform(df)
          result = b.transform(dask_data)
      else:
          expected = a.fit_transform(df)
          result = b.fit_transform(dask_data)
  
      assert_estimator_equal(
          a,
          b,
          exclude={
              "n_values_",
              "feature_indices_",
              "active_features_",
              "dtypes_",
              "drop_idx_",
              "infrequent_categories_",
          },
      )
  
      assert isinstance(result, type(dask_data))
      assert len(result.columns) == expected.shape[1]
      if sparse_output and PANDAS_VERSION >= packaging.version.parse(
          "0.24.0"
      ):
          # pandas sparse ExtensionDtype interface
          dtype = pd.SparseDtype(dtype, dtype(0))
      assert (result.dtypes == dtype).all()
      if sparse_output:
          expected = expected.toarray()
  
      da.utils.assert_eq(result.values, 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 2 for calling a global function with example usage: test_basic_dataframe(sparse_output, method, dask_data, dtype) without return types