def validate_positive_float(option, value):
 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

def validate_positive_float ( option , value ) : 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
validates that value is a float .