code: def entropy(x):
      """ "
      Returns entropy for a random variable x
      H(x) = - Σ p(x)log(p(x))
      :param x : random variable to calculate entropy for
      :returns : entropy of random variable
      """
      d = defaultdict(lambda: 0)
      s = 0.0
      entr = 0.0
      for i in x:
          d[i] += 1  # Calculating frequency of an event
          s += 1
      for i in d:
          p = d[i] / s  # Calculating probability for an event
          entr -= p * log(p, 2)  # H(x) = - Σ p(x)log(p(x))
      return entr
  
file_path: dowhy/dowhy/utils/cit.py
imports: from collections import defaultdict
  from math import log
  import numpy
  from scipy.stats import norm, t
label_desc: Use image node_id 3 for calling a global function with example usage: entropy(x) and returns: entr