def scale_to_unit_interval(ndar, eps=1e-8):
    """
    Scales all values in the ndarray ndar to be between 0 and 1

    Parameters
    ----------
    ndar : WRITEME
    eps : WRITEME

    Returns
    -------
    WRITEME
    """
    ndar = ndar.copy()
    ndar -= ndar.min()
    ndar *= 1.0 / (ndar.max() + eps)
    return ndar
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/utils/image.py/scale_to_unit_interval/original