code: def discrimination(prob, outcome, n_bins=10):
      """Discrimination measurement for a set of predictions.
  
      For each judgement category, how far from the base probability
      is the true frequency of that bin?
      NOTE: High scores are better
  
      prob: array_like, float
          Probability estimates for a set of events
  
      outcome: array_like, bool
          If event predicted occurred
  
      n_bins: int
          Number of judgement categories to prefrom calculation over.
          Prediction are binned based on probability, since "descrete"
          probabilities aren't required.
  
      """
      prob = np.array(prob)
      outcome = np.array(outcome)
  
      d = 0.0
      # Base frequency of outcomes
      base_prob = np.mean(outcome)
      # Construct bins
      judgement_bins = np.arange(n_bins + 1) / n_bins
      # Which bin is each prediction in?
      bin_num = np.digitize(prob, judgement_bins)
      for j_bin in np.unique(bin_num):
          in_bin = bin_num == j_bin
          true_bin_prob = np.mean(outcome[in_bin])
          # Squared distance between true and base times num of obs
          d += np.sum(in_bin) * ((true_bin_prob - base_prob) ** 2)
      return d / len(prob)
  
label_desc: Use image node_id 2 for calling a global function with example usage: discrimination(prob, outcome, n_bins) and returns: unknown