code: def test_given_categorical_data_when_auto_estimate_kl_divergence_then_correctly_selects_categorical_version():
      X = np.random.choice(
          4, 1000, replace=True, p=[0.25, 0.5, 0.125, 0.125]
      ).astype(str)
      Y = np.random.choice(
          4, 1000, replace=True, p=[0.5, 0.25, 0.125, 0.125]
      ).astype(str)
  
      assert auto_estimate_kl_divergence(X, X) == approx(0)
      assert auto_estimate_kl_divergence(X, Y) == approx(
          0.25 * np.log(0.25 / 0.5) + 0.5 * np.log(0.5 / 0.25), abs=0.1
      )
  
file_path: dowhy/tests/gcm/test_divergence.py
imports: import numpy
  from flaky import flaky
  from pytest import approx
  from dowhy.gcm.divergence import auto_estimate_kl_divergence, estimate_kl_divergence_categorical, estimate_kl_divergence_continuous_clf, estimate_kl_divergence_continuous_knn, estimate_kl_divergence_of_probabilities, is_probability_matrix
label_desc: Use image node_id 5 for calling a global function with example usage: test_given_categorical_data_when_auto_estimate_kl_divergence_then_correctly_selects_categorical_version() without return types