def getdistribfunc(distrib, funcname):
    """
    Returns the distrib.funcname function for recognized funcnames
    """
    if ( funcname == "cdf" ):
        return distrib.cdf
    elif ( funcname == "isf" ):
        return distrib.isf
    elif ( funcname == "pdf" ):
        return distrib.pdf
    elif ( funcname == "pmf" ):
        return distrib.pmf
    elif ( funcname == "ppf" ):
        return distrib.ppf
    elif ( funcname == "sf" ):
        return distrib.sf
    elif ( funcname == "rvs" ):
        return distrib.rvs
    else:
        raise ValueError("Unsupported scipy.stats function name '%s'" % funcname)