def interpolateRecallPoints(recallPoints):
    """
    Get a list of interpolated precision and recall. I.e., transforms the list
    of recall points in a list of recall points with 11 points.

    Does't change the recallPoints list.

    param recallPoints: a list of recall points in pairs (precision, recall),
    the values should belong in the interval [0, 1].
    return: a list with 11 pairs (precision,  recall) of interpolated recall
    points, in the interval [0, 1].
    """
    nRecallPoints = []
    if recallPoints:
        for rPoint in range(0, 101, 10):
            nRecall = rPoint / 100
            try:
                nPrecision = max([p for p, r in recallPoints if nRecall <= r])
            except ValueError:
                for rPoint in range(rPoint, 101,10):
                    nRecall = rPoint / 100
                    nRecallPoints.append((0.0, nRecall))
                break
            nRecallPoints.append((nPrecision, nRecall))
    return nRecallPoints