code: def calibration_curve(y_true, y_prob, normalize=False, n_bins=5):
      """Compute true and predicted probabilities for a calibration curve.
  
      Read more in the :ref:`User Guide <calibration>`.
  
      Parameters
      ----------
      y_true : array, shape (n_samples,)
          True targets.
  
      y_prob : array, shape (n_samples,)
          Probabilities of the positive class.
  
      normalize : bool, optional, default=False
          Whether y_prob needs to be normalized into the bin [0, 1], i.e. is not
          a proper probability. If True, the smallest value in y_prob is mapped
          onto 0 and the largest one onto 1.
  
      n_bins : int
          Number of bins. A bigger number requires more data.
  
      Returns
      -------
      prob_true : array, shape (n_bins,)
          The true probability in each bin (fraction of positives).
  
      prob_pred : array, shape (n_bins,)
          The mean predicted probability in each bin.
  
      References
      ----------
      Alexandru Niculescu-Mizil and Rich Caruana (2005) Predicting Good
      Probabilities With Supervised Learning, in Proceedings of the 22nd
      International Conference on Machine Learning (ICML).
      See section 4 (Qualitative Analysis of Predictions).
      """
      y_true = column_or_1d(y_true)
      y_prob = column_or_1d(y_prob)
  
      if normalize:  # Normalize predicted values into interval [0, 1]
          y_prob = (y_prob - y_prob.min()) / (
              y_prob.max() - y_prob.min()
          )
      elif y_prob.min() < 0 or y_prob.max() > 1:
          raise ValueError(
              "y_prob has values outside [0, 1] and normalize is "
              "set to False."
          )
  
      y_true = _check_binary_probabilistic_predictions(y_true, y_prob)
  
      bins = np.linspace(0.0, 1.0 + 1e-8, n_bins + 1)
      binids = np.digitize(y_prob, bins) - 1
  
      bin_sums = np.bincount(
          binids, weights=y_prob, minlength=len(bins)
      )
      bin_true = np.bincount(
          binids, weights=y_true, minlength=len(bins)
      )
      bin_total = np.bincount(binids, minlength=len(bins))
  
      nonzero = bin_total != 0
      prob_true = bin_true[nonzero] / bin_total[nonzero]
      prob_pred = bin_sums[nonzero] / bin_total[nonzero]
  
      return prob_true, prob_pred
  
imports: from __future__ import division
  import warnings
  from math import log
  import numpy
  from scipy.optimize import fmin_bfgs
  from sklearn.preprocessing import LabelEncoder
  from .base import BaseEstimator, ClassifierMixin, RegressorMixin, clone
  from .preprocessing import label_binarize, LabelBinarizer
  from .utils import check_X_y, check_array, indexable, column_or_1d
  from .utils.validation import check_is_fitted
  from .utils.fixes import signature
  from .isotonic import IsotonicRegression
  from .svm import LinearSVC
  from .model_selection import check_cv
  from .metrics.classification import _check_binary_probabilistic_predictions
label_desc: Use image node_id 2 for calling a global function with example usage: calibration_curve(y_true, y_prob, normalize, n_bins) and returns: prob_true,  prob_pred