def float_range(value):
 try:
  value = float(value)
 except:
  raise argparse.ArgumentTypeError("Invalid float value: '{}'".format(value))
 if ((value < 0.0) or (value > 1.0)):
  raise argparse.ArgumentTypeError("Invalid float value: '{}'".format(value))
 return value

def float_range ( value ) : try : value = float ( value ) except : raise argparse . ArgumentTypeError ( "Invalid float value: '{}'" . format ( value ) ) if ( ( value < 0.0 ) or ( value > 1.0 ) ) : raise argparse . ArgumentTypeError ( "Invalid float value: '{}'" . format ( value ) ) return value
ensures that the provided value is a float integer in the range [0 .