def range_check ( value ):
    """ Checks that *value* can be converted to a value in the range 0.0 to 1.0.

    If so, it returns the floating point value; otherwise, it raises a TraitError.
    """
    value = float( value )
    if 0.0 <= value <= 1.0:
        return value
    raise TraitError
dataset/ETHPy150Open enthought/traitsui/traitsui/null/rgb_color_trait.py/range_check/original