def black(m):
    """Return a function that maps all values from [0.0,m] to 0, and maps
    the range [m,1.0] into [0.0, 1.0] linearly.
    """

    m = float(m)

    def f(x):
        if x <= m:
            return 0.0
        return (x - m) / (1.0 - m)
    return f