def getEqualProbableBins(xs_pdf_cdf, numberOfBins, check=False):
    """Returns the equal probable bins of xs_pdf_cdf as a list."""

    pdf = xs_pdf_cdf.to_pdf_and_cdf()[0]
    epbs = pdf.equalProbableBins(numberOfBins)
    if check:
        numberOfErrors = pdf.checkEqualProbableBinsResult(epbs)
        if numberOfErrors != 0:
            pdf.checkEqualProbableBinsResult(epbs, printResults=True)
            raise Exception( 'checkEqualProbableBinsResult failed for outerDomainValue = %s' % xs_pdf_cdf.outerDomainValue)
    return epbs[1:-1]