def validate_positive_float(option, value):
    """Validates that 'value' is a float, or can be converted to one, and is
       positive.
    """
    errmsg = '%s must be an integer or float' % (option,)
    try:
        value = float(value)
    except ValueError:
        raise ValueError(errmsg)
    except TypeError:
        raise TypeError(errmsg)
    if not 0 < value < 1000000000.0:
        raise ValueError(
            '%s must be greater than 0 and less than one billion' % (option,))
    return value
