code: def gini_impurity(s):
      
      return 1 - sum(prop(s[i], s)**2 for i in range(len(s)))
docs: Calculate the Gini Impurity for a list of samples.
  
      See:
      https://en.wikipedia.org/wiki/Decision_tree_learning#Gini_impurity