code: def entropy(x):
      ent = 0
      for k in set(x):
          p_i = float(x.count(k)) / len(x)
          ent = ent - p_i * math.log(p_i, 2)
      return ent
  
file_path: imodels/imodels/tree/c45_tree/c45_utils.py
imports: import math
label_desc: Use image node_id 4 for calling a global function with example usage: entropy(x) and returns: ent