code: def estimate_entropy_using_discretization(
      X: np.ndarray, bin_width: float = 1
  ) -> float:
      # TODO: Add method for auto select a bin_width/width based on the data. Make sure that the auto selection method is
      #  theoretically sound, i.e. make entropy results from different data comparable.
      X = shape_into_2d(X)
  
      if X.shape[1] > 1:
          raise RuntimeError(
              "The discrete entropy estimator can only handle one dimensional data, but the input data is "
              "%d dimensional!" % X.shape[1]
          )
  
      max_value = np.max(X)
      min_value = np.min(X)
      number_of_bins = max(1, int((max_value - min_value) / bin_width))
      num_samples = X.shape[0]
      return -np.sum(
          [
              (i / num_samples * np.log(i / num_samples))
              if i > 0
              else 0
              for i in np.histogram(
                  X,
                  bins=np.linspace(
                      min_value, max_value, number_of_bins
                  ).reshape(-1),
              )[0]
          ]
      )
  
file_path: dowhy/dowhy/gcm/uncertainty.py
imports: import numpy
  from numpy.linalg import det
  from scipy.special import digamma
  from scipy.stats import entropy
  from sklearn.neighbors import NearestNeighbors
  from dowhy.gcm.constant import EPS
  from dowhy.gcm.util.general import shape_into_2d
label_desc: Use image node_id 1 for calling a global function with example usage: estimate_entropy_using_discretization(X, bin_width) and returns: unknown