code: def test_OneHotEncoder(generate_categorical_data):
      df = generate_categorical_data()
      cat_cols = [
          col for col in df.columns if df[col].dtype == "object"
      ]
      n_category = 0
      for col in cat_cols:
          n_category += df[col].nunique()
  
      ohe = OneHotEncoder(min_obs=2)
      X_cat = ohe.fit_transform(df[cat_cols]).todense()
  
      assert (
          df.shape[0] == X_cat.shape[0] and X_cat.shape[1] < n_category
      )
  
imports: import pandas
  import pytest
  from causalml.features import OneHotEncoder, LabelEncoder, load_data
label_desc: Use image node_id 4 for calling a global function with example usage: test_OneHotEncoder(generate_categorical_data) without return types