code: def test_given_categorical_data_when_fit_one_hot_encoders_and_apply_one_hot_encoding_then_returns_expected_feature_vector():
      data = np.array(
          [["d", 1, "a"], ["b", 2, "d"], ["a", 3, "a"]], dtype=object
      )
      encoders = fit_one_hot_encoders(data)
  
      assert apply_one_hot_encoding(data, encoders) == approx(
          np.array(
              [
                  [0, 0, 1, 1, 1, 0],
                  [0, 1, 0, 2, 0, 1],
                  [1, 0, 0, 3, 1, 0],
              ]
          )
      )
  
imports: import random
  import networkx
  import numpy
  import pandas
  import pytest
  from _pytest.python_api import approx
  from dowhy import gcm
  from dowhy.gcm.util.general import apply_catboost_encoding, apply_one_hot_encoding, auto_apply_encoders, auto_fit_encoders, fit_catboost_encoders, fit_one_hot_encoders, has_categorical, is_categorical, is_discrete, set_random_seed, setdiff2d, shape_into_2d
label_desc: Use image node_id 4 for calling a global function with example usage: test_given_categorical_data_when_fit_one_hot_encoders_and_apply_one_hot_encoding_then_returns_expected_feature_vector() without return types