code: def estimate_kl_divergence_of_probabilities(
      X: np.ndarray, Y: np.ndarray
  ) -> float:
      """Estimates the Kullback-Leibler divergence between each pair of probability vectors (row wise) in X and Y
      separately and returns the mean over all results."""
      X, Y = shape_into_2d(X, Y)
  
      if X.shape[1] != Y.shape[1]:
          raise RuntimeError(
              "Samples from X and Y need to have the same dimension, but X has dimension %d and Y has "
              "dimension %d." % (X.shape[1], Y.shape[1])
          )
  
      return float(np.mean(entropy(X + EPS, Y + EPS, axis=1)))
  
file_path: dowhy/dowhy/gcm/divergence.py
imports: from functools import partial
  from typing import Callable, Union
  import numpy
  from scipy.stats import entropy
  from sklearn.model_selection import KFold
  from sklearn.neighbors import NearestNeighbors
  from dowhy.gcm.auto import AssignmentQuality, select_model
  from dowhy.gcm.constant import EPS
  from dowhy.gcm.ml.classification import ClassificationModel, create_logistic_regression_classifier
  from dowhy.gcm.util.general import has_categorical, is_categorical, setdiff2d, shape_into_2d
label_desc: Use image node_id 5 for calling a global function with example usage: estimate_kl_divergence_of_probabilities(X, Y) and returns: float