def get_dist(dist):
    """Return a distribution object from scipy.stats.
    """
    from scipy import stats

    dc = getattr(stats, dist, None)
    if dc is None:
        e = "Statistical distribution `{}` is not in scipy.stats.".format(dist)
        raise ValueError(e)
    return dc
Return a distribution object from scipy.stats.